diff options
Diffstat (limited to 'src/websockets/qwebsocket_p.cpp')
-rw-r--r-- | src/websockets/qwebsocket_p.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp index 8aa2fe1..3280377 100644 --- a/src/websockets/qwebsocket_p.cpp +++ b/src/websockets/qwebsocket_p.cpp @@ -353,8 +353,9 @@ void QWebSocketPrivate::open(const QUrl &url, bool mask) m_isClosingHandshakeSent = false; setRequestUrl(url); - QString resourceName = url.path(); - if (resourceName.contains(QStringLiteral("\r\n"))) { + QString resourceName = url.path(QUrl::FullyEncoded); + // Check for encoded \r\n + if (resourceName.contains(QStringLiteral("%0D%0A"))) { setRequestUrl(QUrl()); //clear requestUrl setErrorString(QWebSocket::tr("Invalid resource name.")); Q_EMIT q->error(QAbstractSocket::ConnectionRefusedError); |