-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Describe the bug
Setting useragent to null now causes an exception = > The format of value ' ' is invalid
To Reproduce
Old code that worked (no useragent sent in headers)
var client = new RestClient("https://www.example.com.au");
client.UserAgent = null;
New code that fails
var client = new RestClient(new RestClientOptions { BaseUrl = new Uri("https://www.example.com.au"), UserAgent = null });
Stack trace
The format of value ' ' is invalid. Stack at System.Net.Http.Headers.HttpHeaderParser.ParseValue(String value, Object storeValue, Int32& index) at System.Net.Http.Headers.HttpHeaders.ParseAndAddValue(HeaderDescriptor descriptor, HeaderStoreItemInfo info, String value) at System.Net.Http.Headers.HttpHeaders.Add(HeaderDescriptor descriptor, String value) at System.Net.Http.Headers.HttpHeaderValueCollection`1.ParseAdd(String input) at RestSharp.RestClient.ConfigureHttpClient(HttpClient httpClient) at RestSharp.RestCl