Skip to content

Commit

Permalink
Fix authorization headers (#1275)
Browse files Browse the repository at this point in the history
Fix authorization headers to not fail when we hit the first re-request for access tokens.
  • Loading branch information
leculver authored Jul 10, 2024
1 parent f6e7370 commit b54dae8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Diagnostics;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -136,7 +137,7 @@ private static bool IsSymweb(string server)

string? accessToken = await GetAccessTokenAsync().ConfigureAwait(false);
if (accessToken is not null)
_http.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
_http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);

HttpResponseMessage response = await _http.GetAsync(fullPath).ConfigureAwait(false);

Expand Down

0 comments on commit b54dae8

Please sign in to comment.