fix static resource download

This commit is contained in:
qhy040404
2024-02-25 23:29:39 +08:00
parent 1849ac16da
commit 1cf3450264
2 changed files with 3 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ internal static partial class IocHttpClientConfiguration
.ConfigurePrimaryHttpMessageHandler((handler, provider) =>
{
HttpClientHandler clientHandler = (HttpClientHandler)handler;
clientHandler.AllowAutoRedirect = true;
clientHandler.UseProxy = true;
clientHandler.Proxy = provider.GetRequiredService<DynamicHttpProxy>();
});

View File

@@ -76,9 +76,10 @@ internal sealed class DownloadSummary : ObservableObject
{
HttpResponseMessage response = await httpClient.GetAsync(fileUrl, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false);
if (response.Content.Headers.ContentType?.MediaType is not "application/octet-stream")
if (response.Content.Headers.ContentType?.MediaType is not ("application/octet-stream" or "application/zip"))
{
logger.LogWarning("Download Static Zip failed, Content-Type is {Type}", response.Content.Headers.ContentType);
await taskContext.SwitchToMainThreadAsync();
Description = SH.ViewModelWelcomeDownloadSummaryContentTypeNotMatch;
return false;
}