libstore: remove FileTransferRequest::expectedETag

just another http specific used in only one place.

Change-Id: I99361a7226f4e6cd8f18170d3683c0025657bcb3
This commit is contained in:
eldritch horrors 2024-10-27 18:27:11 +01:00
parent 30bec83fa4
commit a839c31e6c
3 changed files with 1 additions and 4 deletions

View file

@ -43,7 +43,7 @@ DownloadFileResult downloadFile(
FileTransferRequest request(url); FileTransferRequest request(url);
request.headers = headers; request.headers = headers;
if (cached) if (cached)
request.expectedETag = getStrAttr(cached->infoAttrs, "etag"); request.headers.emplace_back("If-None-Match", getStrAttr(cached->infoAttrs, "etag"));
FileTransferResult res; FileTransferResult res;
try { try {
res = getFileTransfer()->enqueueDownload(request).get(); res = getFileTransfer()->enqueueDownload(request).get();

View file

@ -111,8 +111,6 @@ struct curlFileTransfer : public FileTransfer
, dataCallback(std::move(dataCallback)) , dataCallback(std::move(dataCallback))
{ {
requestHeaders = curl_slist_append(requestHeaders, "Accept-Encoding: zstd, br, gzip, deflate, bzip2, xz"); 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){ 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()); requestHeaders = curl_slist_append(requestHeaders, fmt("%s: %s", it->first, it->second).c_str());
} }

View file

@ -56,7 +56,6 @@ struct FileTransferRequest
{ {
std::string uri; std::string uri;
Headers headers; Headers headers;
std::string expectedETag;
FileTransferRequest(std::string_view uri) FileTransferRequest(std::string_view uri)
: uri(uri) { } : uri(uri) { }