add user content-type overriding

This commit is contained in:
ortyomka 2024-10-19 22:20:31 +02:00
parent eb4a74d741
commit d9b3a2732b

View File

@ -24,17 +24,17 @@ WriteBufferFromHTTP::WriteBufferFromHTTP(
request.setHost(uri.getHost());
request.setChunkedTransferEncoding(true);
if (!content_type.empty())
{
request.set("Content-Type", content_type);
}
if (!content_encoding.empty())
request.set("Content-Encoding", content_encoding);
for (const auto & header: additional_headers)
request.add(header.name, header.value);
if (!content_type.empty() && !request.has("Content-Type"))
{
request.set("Content-Type", content_type);
}
LOG_TRACE((getLogger("WriteBufferToHTTP")), "Sending request to {}", uri.toString());
ostr = &session->sendRequest(request);