Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
TingluoHuang committed Jan 30, 2024
1 parent c2b097d commit debdaea
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Runner.Sdk/Util/VssUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ public static void InitializeVssClientSettings(List<ProductInfoHeaderValue> addi
VssClientHttpRequestSettings.Default.ServerCertificateValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
}

var resultsHeaderValues = new List<ProductInfoHeaderValue>();
resultsHeaderValues.AddRange(additionalUserAgents);
resultsHeaderValues.Add(new ProductInfoHeaderValue($"({StringUtil.SanitizeUserAgentHeader(RuntimeInformation.OSDescription)})"));
var rawHeaderValues = new List<ProductInfoHeaderValue>();
rawHeaderValues.AddRange(additionalUserAgents);
rawHeaderValues.Add(new ProductInfoHeaderValue($"({StringUtil.SanitizeUserAgentHeader(RuntimeInformation.OSDescription)})"));

if (RawClientHttpRequestSettings.Default.UserAgent != null && RawClientHttpRequestSettings.Default.UserAgent.Count > 0)
{
foreach (var headerVal in RawClientHttpRequestSettings.Default.UserAgent)
{
if (!resultsHeaderValues.Contains(headerVal))
if (!rawHeaderValues.Contains(headerVal))
{
resultsHeaderValues.Add(headerVal);
rawHeaderValues.Add(headerVal);
}
}
}

RawClientHttpRequestSettings.Default.UserAgent = resultsHeaderValues;
RawClientHttpRequestSettings.Default.UserAgent = rawHeaderValues;
}

public static VssConnection CreateConnection(
Expand Down

0 comments on commit debdaea

Please sign in to comment.