From dc82160164d6c74586b448a13443c19b5a6709c1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 6 Apr 2016 16:57:20 +0200 Subject: Fix "tar: This does not look like a tar archive" with fetchTarball / -I http:// The 304 Not Modified was not handled correctly, so the empty result from the conditional request would overwrite the previous tarball. --- src/libstore/download.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/libstore/download.cc') diff --git a/src/libstore/download.cc b/src/libstore/download.cc index b3a79e82a383..c34fa4ab8782 100644 --- a/src/libstore/download.cc +++ b/src/libstore/download.cc @@ -179,8 +179,7 @@ struct CurlDownloader : public Downloader if (res == CURLE_WRITE_ERROR && etag == options.expectedETag) return false; long httpStatus = -1; - if (res == CURLE_HTTP_RETURNED_ERROR) - curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &httpStatus); + curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &httpStatus); if (res != CURLE_OK) { Error err = -- cgit 1.4.1