From 7d24e1c0636cd6938e2235c5b67ee0d9489ca916 Mon Sep 17 00:00:00 2001 From: FranciscoPombal Date: Sun, 22 Mar 2020 03:49:06 +0000 Subject: [PATCH] WebAPI: fix matching uncategorized torrents Closes #11748. --- src/base/http/requestparser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/base/http/requestparser.cpp b/src/base/http/requestparser.cpp index 524c57772..ef7a94c30 100644 --- a/src/base/http/requestparser.cpp +++ b/src/base/http/requestparser.cpp @@ -201,7 +201,9 @@ bool RequestParser::parseRequestLine(const QString &line) const QByteArray nameComponent = midView(param, 0, eqCharPos); const QByteArray valueComponent = midView(param, (eqCharPos + 1)); const QString paramName = QString::fromUtf8(QByteArray::fromPercentEncoding(nameComponent).replace('+', ' ')); - const QByteArray paramValue = QByteArray::fromPercentEncoding(valueComponent).replace('+', ' '); + const QByteArray paramValue = valueComponent.isNull() + ? "" + : QByteArray::fromPercentEncoding(valueComponent).replace('+', ' '); m_request.query[paramName] = paramValue; }