Correctly handle '+' sign in x-www-form-urlencoded data

Fixes #10451.
This commit is contained in:
Chocobo1 2019-04-07 03:30:15 +08:00
commit be74987084
No known key found for this signature in database
GPG key ID: 210D9C873253A68C

View file

@ -203,7 +203,10 @@ bool RequestParser::parsePostMessage(const QByteArray &data)
// application/x-www-form-urlencoded
if (contentTypeLower.startsWith(CONTENT_TYPE_FORM_ENCODED)) {
QListIterator<QStringPair> i(QUrlQuery(data).queryItems(QUrl::FullyDecoded));
// [URL Standard] 5.1 application/x-www-form-urlencoded parsing
const QByteArray processedData = QByteArray(data).replace('+', ' ');
QListIterator<QStringPair> i(QUrlQuery(processedData).queryItems(QUrl::FullyDecoded));
while (i.hasNext()) {
const QStringPair pair = i.next();
m_request.posts[pair.first] = pair.second;