mirror of
https://github.com/NixOS/nix
synced 2025-07-08 06:53:54 +02:00
Merge pull request #4475 from matthewbauer/fix-4469-backport-2-3
[backport 2.3] Fix #4469
This commit is contained in:
commit
3cdd464212
1 changed files with 7 additions and 0 deletions
|
@ -349,6 +349,13 @@ struct CurlDownloader : public Downloader
|
|||
(httpStatus == 200 || httpStatus == 201 || httpStatus == 204 || httpStatus == 206 || httpStatus == 304 || httpStatus == 226 /* FTP */ || httpStatus == 0 /* other protocol */))
|
||||
{
|
||||
result.cached = httpStatus == 304;
|
||||
|
||||
// In 2021, GitHub responds to If-None-Match with 304,
|
||||
// but omits ETag. We just use the If-None-Match etag
|
||||
// since 304 implies they are the same.
|
||||
if (httpStatus == 304 && result.etag == "")
|
||||
result.etag = request.expectedETag;
|
||||
|
||||
act.progress(result.bodySize, result.bodySize);
|
||||
done = true;
|
||||
callback(std::move(result));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue