Fix _makeRequest in HttpClient.cs

This commit is contained in:
Denis-Cosmin Nutiu 2020-04-19 13:27:45 +03:00
parent 9414f6d752
commit a05d724734

View file

@ -186,14 +186,10 @@ namespace NucuCar.Common
/// <returns></returns> /// <returns></returns>
private sNetHttp.HttpRequestMessage _makeRequest(sNetHttp.HttpMethod method, string path) private sNetHttp.HttpRequestMessage _makeRequest(sNetHttp.HttpMethod method, string path)
{ {
var requestUri = path.ToLowerInvariant().StartsWith("http://")
? new Uri(path)
: new Uri(_httpClient.BaseAddress, path);
var requestMessage = new sNetHttp.HttpRequestMessage var requestMessage = new sNetHttp.HttpRequestMessage
{ {
Method = method, Method = method,
RequestUri = requestUri RequestUri = new Uri(_httpClient.BaseAddress, path)
}; };
requestMessage.Headers.Authorization = _httpClient.DefaultRequestHeaders.Authorization; requestMessage.Headers.Authorization = _httpClient.DefaultRequestHeaders.Authorization;