From 26983aef39a702d2de7c519b5a3f7a8150c8beeb Mon Sep 17 00:00:00 2001 From: Lander Noterman Date: Fri, 15 Nov 2019 14:21:37 +0100 Subject: Don't add port in Host header unless specified MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No longer add port to Host header in WebSocket handshake unless it was explicitly specified in the URL. This change fixes issues with some WebSocket servers rejecting the connection if the Host header does not match the URL. Fixes: QTBUG-77526 Change-Id: I9b028ce434416e61cae7b217d2eafe621d2660b4 Reviewed-by: Mårten Nordheim --- src/websockets/qwebsocket_p.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp index 36aefd9..bca4ccd 100644 --- a/src/websockets/qwebsocket_p.cpp +++ b/src/websockets/qwebsocket_p.cpp @@ -1099,9 +1099,6 @@ void QWebSocketPrivate::processStateChanged(QAbstractSocket::SocketState socketS Q_ASSERT(m_pSocket); Q_Q(QWebSocket); QAbstractSocket::SocketState webSocketState = this->state(); - int port = 80; - if (m_request.url().scheme() == QStringLiteral("wss")) - port = 443; switch (socketState) { case QAbstractSocket::ConnectedState: @@ -1120,11 +1117,10 @@ void QWebSocketPrivate::processStateChanged(QAbstractSocket::SocketState socketS const auto format = QUrl::RemoveScheme | QUrl::RemoveUserInfo | QUrl::RemovePath | QUrl::RemoveQuery - | QUrl::RemoveFragment | QUrl::RemovePort; + | QUrl::RemoveFragment; const QString host = m_request.url().toString(format).mid(2); const QString handshake = createHandShakeRequest(m_resourceName, - host % QStringLiteral(":") - % QString::number(m_request.url().port(port)), + host, origin(), QString(), QString(), -- cgit v1.2.1 From 9ef6658541c2e816b8119df98c1b66add5b7bcdd Mon Sep 17 00:00:00 2001 From: Antti Kokko Date: Mon, 18 Nov 2019 13:01:23 +0200 Subject: Add changes file for Qt 5.14.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic759bffc47f236217fde5db2c33260577366efc1 Reviewed-by: Mårten Nordheim Reviewed-by: Timur Pocheptsov --- dist/changes-5.14.0 | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 dist/changes-5.14.0 diff --git a/dist/changes-5.14.0 b/dist/changes-5.14.0 new file mode 100644 index 0000000..41322ed --- /dev/null +++ b/dist/changes-5.14.0 @@ -0,0 +1,35 @@ +Qt 5.14 introduces many new features and improvements as well as bugfixes +over the 5.13.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.14 series is binary compatible with the 5.13.x series. +Applications compiled for 5.13 will continue to run with 5.14. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* QWebSocket * +**************************************************************************** + + - [QTBUG-74464] QWebSocket no longer marks the connection as timed out + if it cannot read a whole message within 5 seconds. It will also no + longer block for up to 5 seconds when receiving a message. + +**************************************************************************** +* QWebSocketServer * +**************************************************************************** + + - [QTBUG-57026] [QTBUG-63312] Handshake timeout + * Added a timeout to the websocket handshake, 10 seconds by default. + * Call setHandshakeTimeout() to change the maximum duration. + Negative values mean it will not time out. + * handshakeTimeout() and handshakeTimeoutMS() can be used to query the + current timeout duration. -- cgit v1.2.1