Skip to content

Commit

Permalink
httpupload: Send content-type with http request if ever requested via…
Browse files Browse the repository at this point in the history
… xmpp.

Closes psi-im/plugins#90
  • Loading branch information
Ri0n committed May 2, 2021
1 parent 669417b commit c82f036
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/xmpp/xmpp-im/httpfileupload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,11 @@ void HttpFileUpload::tryNextServer()
setState(State::HttpRequest);
// time for a http request
QNetworkRequest req(d->result.putUrl);
for (auto &h : d->result.putHeaders) {
for (auto &h : d->result.putHeaders)
req.setRawHeader(h.name.toLatin1(), h.value.toLatin1());
}
if (!d->mediaType.isEmpty())
req.setHeader(QNetworkRequest::ContentTypeHeader, d->mediaType);

auto reply = d->qnam->put(req, d->sourceDevice);
connect(reply, &QNetworkReply::uploadProgress, this, &HttpFileUpload::progress);
connect(reply, &QNetworkReply::finished, this, [this, reply]() {
Expand Down

0 comments on commit c82f036

Please sign in to comment.