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");
|
requestHeaders = curl_slist_append(requestHeaders, "Accept-Encoding: zstd, br, gzip, deflate, bzip2, xz");
|
||||||
if (!request.expectedETag.empty())
|
if (!request.expectedETag.empty())
|
||||||
requestHeaders = curl_slist_append(requestHeaders, ("If-None-Match: " + request.expectedETag).c_str());
|
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){
|
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());
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,6 @@ struct FileTransferRequest
|
||||||
unsigned int baseRetryTimeMs = 250;
|
unsigned int baseRetryTimeMs = 250;
|
||||||
ActivityId parentAct;
|
ActivityId parentAct;
|
||||||
std::optional<std::string> data;
|
std::optional<std::string> data;
|
||||||
std::string mimeType;
|
|
||||||
|
|
||||||
FileTransferRequest(std::string_view uri)
|
FileTransferRequest(std::string_view uri)
|
||||||
: uri(uri), parentAct(getCurActivity()) { }
|
: uri(uri), parentAct(getCurActivity()) { }
|
||||||
|
|
|
@ -134,7 +134,7 @@ protected:
|
||||||
{
|
{
|
||||||
FileTransferRequest req{makeURI(path)};
|
FileTransferRequest req{makeURI(path)};
|
||||||
req.data = StreamToSourceAdapter(istream).drain();
|
req.data = StreamToSourceAdapter(istream).drain();
|
||||||
req.mimeType = mimeType;
|
req.headers = {{"Content-Type", mimeType}};
|
||||||
try {
|
try {
|
||||||
getFileTransfer()->transfer(req);
|
getFileTransfer()->transfer(req);
|
||||||
} catch (FileTransferError & e) {
|
} catch (FileTransferError & e) {
|
||||||
|
|
Loading…
Reference in a new issue