Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -981,11 +981,15 @@ static async Task DownloadAndInstallPackage(string displayName, string url, stri
Logger.WriteSubProgress("Downloading from", url);
DialogManager.Instance.NotifyDownloadStarted(displayName);

using var httpClient = new HttpClient();
// Use a 10-minute timeout so large MSIs (e.g. CimianTools ARM64) don't hit
// the 100-second HttpClient default on slow links. ResponseHeadersRead lets
// GetAsync return as soon as headers arrive; the body streams via CopyToAsync
// which is not subject to HttpClient.Timeout.
using var httpClient = new HttpClient { Timeout = TimeSpan.FromMinutes(10) };
Comment on lines +984 to +988
var authHeader = ConfigManager.Instance.Config.AuthorizationHeader;
if (!string.IsNullOrEmpty(authHeader))
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", authHeader);
using var response = await httpClient.GetAsync(url);
using var response = await httpClient.GetAsync(url, HttpCompletionOption.ResponseHeadersRead);
if (!response.IsSuccessStatusCode)
{
throw new Exception($"Download failed: {response.StatusCode}");
Expand Down
Loading