mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 04:49:47 -07:00
Merge pull request #10458 from Chocobo1/post
Correctly handle '+' sign in x-www-form-urlencoded data
This commit is contained in:
commit
4a02922bfb
1 changed files with 4 additions and 1 deletions
|
@ -205,7 +205,10 @@ bool RequestParser::parsePostMessage(const QByteArray &data)
|
||||||
|
|
||||||
// application/x-www-form-urlencoded
|
// application/x-www-form-urlencoded
|
||||||
if (contentTypeLower.startsWith(CONTENT_TYPE_FORM_ENCODED)) {
|
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()) {
|
while (i.hasNext()) {
|
||||||
const QStringPair pair = i.next();
|
const QStringPair pair = i.next();
|
||||||
m_request.posts[pair.first] = pair.second;
|
m_request.posts[pair.first] = pair.second;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue