We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11bbfc3 commit 28b5478Copy full SHA for 28b5478
src/RestSharp/RestClient.cs
@@ -129,7 +129,7 @@ void ConfigureHttpClient(HttpClient httpClient) {
129
if (Options.MaxTimeout > 0) httpClient.Timeout = TimeSpan.FromMilliseconds(Options.MaxTimeout);
130
131
if (Options.UserAgent != null && httpClient.DefaultRequestHeaders.UserAgent.All(x => x.Product?.Name != Options.UserAgent)) {
132
- httpClient.DefaultRequestHeaders.UserAgent.ParseAdd(Options.UserAgent);
+ httpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", Options.UserAgent);
133
}
134
135
if (Options.Expect100Continue != null) httpClient.DefaultRequestHeaders.ExpectContinue = Options.Expect100Continue;
0 commit comments