Oops fix header processing for multipart

This commit is contained in:
ArsenArsen 2017-06-24 19:58:42 +02:00
parent 99d0654727
commit c621c0db3e

View File

@ -319,12 +319,15 @@ void CustomUploader::doUpload(QByteArray imgData, QString format) {
multipart->append(part); multipart->append(part);
} }
for (QString headerVal : valo.keys()) { for (QString headerVal : valo.keys()) {
if (headerVal.startsWith("__")) {
headerVal = headerVal.mid(2);
QString str = valo[headerVal].toString(); QString str = valo[headerVal].toString();
if (str.startsWith("/") && str.endsWith("/")) if (str.startsWith("/") && str.endsWith("/"))
str = str.mid(1, str.length() - 1).replace("%contenttype", mime); str = str.mid(1, str.length() - 1).replace("%contenttype", mime);
part.setRawHeader(headerVal.toLatin1(), str.toLatin1()); part.setRawHeader(headerVal.toLatin1(), str.toLatin1());
} }
} }
}
switch (method) { switch (method) {
case HttpMethod::POST: case HttpMethod::POST:
if (returnPathspec == "|") { if (returnPathspec == "|") {