diff --git a/src/libfetchers/tarball.cc b/src/libfetchers/tarball.cc index 69ed53f79..8236c5ea1 100644 --- a/src/libfetchers/tarball.cc +++ b/src/libfetchers/tarball.cc @@ -43,7 +43,7 @@ DownloadFileResult downloadFile( FileTransferRequest request(url); request.headers = headers; if (cached) - request.expectedETag = getStrAttr(cached->infoAttrs, "etag"); + request.headers.emplace_back("If-None-Match", getStrAttr(cached->infoAttrs, "etag")); FileTransferResult res; try { res = getFileTransfer()->enqueueDownload(request).get(); diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index fc1353349..11f369efd 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -111,8 +111,6 @@ struct curlFileTransfer : public FileTransfer , dataCallback(std::move(dataCallback)) { requestHeaders = curl_slist_append(requestHeaders, "Accept-Encoding: zstd, br, gzip, deflate, bzip2, xz"); - if (!request.expectedETag.empty()) - requestHeaders = curl_slist_append(requestHeaders, ("If-None-Match: " + request.expectedETag).c_str()); for (auto it = request.headers.begin(); it != request.headers.end(); ++it){ requestHeaders = curl_slist_append(requestHeaders, fmt("%s: %s", it->first, it->second).c_str()); } diff --git a/src/libstore/filetransfer.hh b/src/libstore/filetransfer.hh index ed22578a2..09f7d5c7f 100644 --- a/src/libstore/filetransfer.hh +++ b/src/libstore/filetransfer.hh @@ -56,7 +56,6 @@ struct FileTransferRequest { std::string uri; Headers headers; - std::string expectedETag; FileTransferRequest(std::string_view uri) : uri(uri) { }