forked from lix-project/lix
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:
parent
a8d6577bf0
commit
a83bf24281
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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()) { }
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue