mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 15:27:54 +00:00
Merge pull request #13042 from FranciscoPombal/fix_request_parser
Fix truncation when parsing HTTP request query
This commit is contained in:
commit
06e1b07274
@ -36,6 +36,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
# defines
|
||||
add_definitions(-DQT_DEPRECATED_WARNINGS)
|
||||
add_definitions(-DQT_NO_CAST_TO_ASCII)
|
||||
add_definitions(-DQT_NO_CAST_FROM_BYTEARRAY)
|
||||
add_definitions(-DQT_USE_QSTRINGBUILDER)
|
||||
add_definitions(-DQT_STRICT_ITERATORS)
|
||||
|
||||
|
@ -202,7 +202,7 @@ bool RequestParser::parseRequestLine(const QString &line)
|
||||
const QByteArray valueComponent = midView(param, (eqCharPos + 1));
|
||||
const QString paramName = QString::fromUtf8(QByteArray::fromPercentEncoding(nameComponent).replace('+', ' '));
|
||||
const QByteArray paramValue = valueComponent.isNull()
|
||||
? ""
|
||||
? QByteArray("")
|
||||
: QByteArray::fromPercentEncoding(valueComponent).replace('+', ' ');
|
||||
|
||||
m_request.query[paramName] = paramValue;
|
||||
|
@ -57,6 +57,7 @@ include(../version.pri)
|
||||
# Qt defines
|
||||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
DEFINES += QT_NO_CAST_TO_ASCII
|
||||
DEFINES += QT_NO_CAST_FROM_BYTEARRAY
|
||||
DEFINES += QT_USE_QSTRINGBUILDER
|
||||
DEFINES += QT_STRICT_ITERATORS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user