Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
None
-
5.10.0
-
None
Description
Some minor issue.
In case of websocket connection error QWebSocket::errorString() can return a string like that:
QWebSocketPrivate::processHandshake: Unhandled http status code: 403 (Forbidden\r\n).
Those '\r\n' wasn't stripped from HTTP response status line and looks quite ugly inside logging.
This small patch can deal with this problem:
diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp index dda20f7..ba3ea8f 100644 --- a/src/websockets/qwebsocket_p.cpp +++ b/src/websockets/qwebsocket_p.cpp @@ -935,7 +935,7 @@ static bool parseStatusLine(const QByteArray &status, int *majorVersion, int *mi bool ok; *statusCode = code.toInt(&ok); - *reasonPhrase = QString::fromLatin1(status.constData() + j + 1); + *reasonPhrase = QString::fromLatin1(status.constData() + j + 1).trimmed(); return ok && uint(*majorVersion) <= 9 && uint(* minorVersion) <= 9; }
Attachments
For Gerrit Dashboard: QTBUG-67424 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
238027,2 | Remove unneeded CRLF ending from status line | dev | qt/qtwebsockets | Status: MERGED | +2 | 0 |