From b0a300f71b1a6d6bd7cc6e09544641ec1f5d159d Mon Sep 17 00:00:00 2001 From: JusterZhu Date: Mon, 22 Jun 2026 15:18:05 +0800 Subject: [PATCH] fix: HttpDownloadExecutor now calls ApplyAuthAsync for download requests Download requests were missing the global auth provider and ExtraHeaders (e.g. X-Tenant-Id) from HttpClientProvider, while version validation and status reporting already applied them. This caused tenant-scoped file downloads to fail when the server requires X-Tenant-Id header. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../Download/Executors/HttpDownloadExecutor.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/c#/GeneralUpdate.Core/Download/Executors/HttpDownloadExecutor.cs b/src/c#/GeneralUpdate.Core/Download/Executors/HttpDownloadExecutor.cs index bcba7b85..78a24482 100644 --- a/src/c#/GeneralUpdate.Core/Download/Executors/HttpDownloadExecutor.cs +++ b/src/c#/GeneralUpdate.Core/Download/Executors/HttpDownloadExecutor.cs @@ -5,6 +5,7 @@ using System.Threading; using System.Threading.Tasks; using GeneralUpdate.Core.Download.Abstractions; +using GeneralUpdate.Core.Network; using GeneralUpdate.Core.Download.Models; namespace GeneralUpdate.Core.Download.Executors; @@ -119,6 +120,11 @@ public async Task ExecuteAsync( new System.Net.Http.Headers.AuthenticationHeaderValue(asset.AuthScheme, asset.AuthToken); } + // Apply global auth provider and extra headers (e.g. X-Tenant-Id) from HttpClientProvider. + // This ensures download requests carry the same auth context as version validation + // and status reporting requests. + await HttpClientProvider.ApplyAuthAsync(request, token).ConfigureAwait(false); + using var cts = CancellationTokenSource.CreateLinkedTokenSource(token); cts.CancelAfter(_timeout);