diff options
author | Kurt Pattyn <pattyn.kurt@gmail.com> | 2013-10-05 15:24:16 +0200 |
---|---|---|
committer | Kurt Pattyn <pattyn.kurt@gmail.com> | 2013-10-05 18:35:30 +0200 |
commit | beca818e95c8ac1fed261f2f41c8078558f48230 (patch) | |
tree | 7414f190310d9bd3d149bee5cc7fe7f7f0fe035c /src | |
parent | f3dc27dbcc333cd287b707a91e8204d45e6a5ae0 (diff) | |
download | qtwebsockets-beca818e95c8ac1fed261f2f41c8078558f48230.tar.gz |
Check on ending '?' before adding a '?' (led to an internal server error of Autobahn)
Change-Id: Id51b6ae1eabfda7e0daa3eaa64be93bc6140afbb
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/websockets/qwebsocket_p.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp index bbf4748..1e8684e 100644 --- a/src/websockets/qwebsocket_p.cpp +++ b/src/websockets/qwebsocket_p.cpp @@ -249,7 +249,11 @@ void QWebSocketPrivate::open(const QUrl &url, bool mask) QString resourceName = url.path(); if (!url.query().isEmpty()) { - resourceName.append(QStringLiteral("?") % url.query()); + if (!resourceName.endsWith(QChar::fromLatin1('?'))) + { + resourceName.append(QChar::fromLatin1('?')); + } + resourceName.append(url.query()); } if (resourceName.isEmpty()) { @@ -745,7 +749,7 @@ void QWebSocketPrivate::processHandshake(QTcpSocket *pSocket) } else { - errorDescription = tr("Invalid statusline in response: %1.").arg(statusLine); + errorDescription = tr("QWebSocketPrivate::processHandshake: Invalid statusline in response: %1.").arg(statusLine); } } else if (httpStatusCode == 400) //HTTP/1.1 400 Bad Request @@ -763,14 +767,14 @@ void QWebSocketPrivate::processHandshake(QTcpSocket *pSocket) else { //we tried v13, but something different went wrong - errorDescription = tr("Unknown error condition encountered. Aborting connection."); + errorDescription = tr("QWebSocketPrivate::processHandshake: Unknown error condition encountered. Aborting connection."); ok = false; } } } else { - errorDescription = tr("Unhandled http status code: %1.").arg(httpStatusCode); + errorDescription = tr("QWebSocketPrivate::processHandshake: Unhandled http status code: %1 (%2).").arg(httpStatusCode).arg(httpStatusMessage); ok = false; } |