libstore: remove FileTransferRequest::mimeType

it's only used by HttpBinaryCacheStore, and even there used in only on
place. this one place can set the header explicitly, which it now does

Change-Id: Id89228150669e25e7f59a3d6bd939e46059ce29e
This commit is contained in:
eldritch horrors 2024-10-26 14:46:16 +02:00
parent a8d6577bf0
commit a83bf24281
3 changed files with 1 additions and 4 deletions

View file

@ -97,8 +97,6 @@ struct curlFileTransfer : public FileTransfer
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());
if (!request.mimeType.empty())
requestHeaders = curl_slist_append(requestHeaders, ("Content-Type: " + request.mimeType).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());
}

View file

@ -63,7 +63,6 @@ struct FileTransferRequest
unsigned int baseRetryTimeMs = 250;
ActivityId parentAct;
std::optional<std::string> data;
std::string mimeType;
FileTransferRequest(std::string_view uri)
: uri(uri), parentAct(getCurActivity()) { }

View file

@ -134,7 +134,7 @@ protected:
{
FileTransferRequest req{makeURI(path)};
req.data = StreamToSourceAdapter(istream).drain();
req.mimeType = mimeType;
req.headers = {{"Content-Type", mimeType}};
try {
getFileTransfer()->transfer(req);
} catch (FileTransferError & e) {