forked from lix-project/lix
libstore: remove FileTransferRequest::expectedETag
just another http specific used in only one place.
Change-Id: I99361a7226f4e6cd8f18170d3683c0025657bcb3
This commit is contained in:
parent
30bec83fa4
commit
a839c31e6c
|
@ -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();
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -56,7 +56,6 @@ struct FileTransferRequest
|
|||
{
|
||||
std::string uri;
|
||||
Headers headers;
|
||||
std::string expectedETag;
|
||||
|
||||
FileTransferRequest(std::string_view uri)
|
||||
: uri(uri) { }
|
||||
|
|
Loading…
Reference in a new issue