From a839c31e6cc4330e3d714c2609a46de49d11ce6a Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sun, 27 Oct 2024 18:27:11 +0100 Subject: [PATCH] libstore: remove FileTransferRequest::expectedETag just another http specific used in only one place. Change-Id: I99361a7226f4e6cd8f18170d3683c0025657bcb3 --- src/libfetchers/tarball.cc | 2 +- src/libstore/filetransfer.cc | 2 -- src/libstore/filetransfer.hh | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) 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) { }