Skip to content

Commit

Permalink
fix authorization for subject image request (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
kookxiang committed Dec 6, 2024
1 parent d055bcc commit 38ae43f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Jellyfin.Plugin.Bangumi/BangumiApi.Jellyfin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public async Task<string> Post(string url, HttpContent content, string? accessTo
{
var httpClient = GetHttpClient(new HttpClientHandler { AllowAutoRedirect = false });
var request = new HttpRequestMessage(HttpMethod.Get, url);
if (store.GetAvailable() != null) request.Headers.Authorization = AuthenticationHeaderValue.Parse("Bearer " + store.GetAvailable()?.AccessToken);

using var response = await httpClient.SendAsync(request, token);
return response.StatusCode is HttpStatusCode.MovedPermanently or HttpStatusCode.Redirect
? response.Headers.Location?.ToString()
Expand Down

0 comments on commit 38ae43f

Please sign in to comment.