If downloads take longer than the timeout (default 5 secs or customized via clientConfigurator the downloads times out even though the download is still progressing.
The 5 second timeout should only be considered for the HTTP request, there should either be a higher or no timeout for the actual file download. Or technically said: Nuke should start the download via httpClient.GetAsync(uri, HttpCompletionOption.ResponseHeadersRead).
Actual Behavior
Downloads timeout after 5 seconds.
Regression?
No response
Known Workarounds
Increase the timeout of the HTTP client and accept the fact that the whole file will be read before progressing (instead of streaming the download to disk).
Usage Information
8.1.2, net8.0, Windows
Description
The default behavior of HttpClient is to complete a HTTP request when the whole response is completed.
https://github.com/nuke-build/nuke/blob/c8d9236a19446f15c1b6b2e22a6f4b4f474d20ca/source/Nuke.Common/IO/HttpTasks.cs#L58
https://github.com/dotnet/runtime/blob/529be78d1b71a8dac510ddcc14d37ae6c244b5f7/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs#L22
If downloads take longer than the timeout (default 5 secs or customized via
clientConfigurator
the downloads times out even though the download is still progressing.Reproduction Steps
HttpTasks.HttpDownloadFile("https://releases.ubuntu.com/24.04.1/ubuntu-24.04.1-desktop-amd64.iso
, RootDirectory / "ubuntu.iso")`Expected Behavior
httpClient.GetAsync(uri, HttpCompletionOption.ResponseHeadersRead)
.Actual Behavior
Regression?
No response
Known Workarounds
Increase the timeout of the HTTP client and accept the fact that the whole file will be read before progressing (instead of streaming the download to disk).
Could you help with a pull-request?
Yes