Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.5.1, 5.6.3, 5.7.2, 5.8.0 RC
-
None
-
670266a075c7c312c6a7f9465298bfec0b968ee2
Description
The QWebSocketHandshakeRequest::readHandshake() method is use indexOf(":") to find the port number, but the IPv6 address also uses the same colon notation (e.g http://[some:ipv6::address]:port).
Therefore, we need to find the last colon character to get the port number.
— qwebsockethandshakerequest.cpp 2016-11-28 23:54:05.575851091 +0800
+++ qwebsockethandshakerequest.patch.cpp 2016-11-28 23:53:52.675850649 +0800
@@ -269,7 +269,7 @@
if (m_requestUrl.isRelative()) {
// see http://tools.ietf.org/html/rfc6455#page-17
// No. 4 item in "The requirements for this handshake"
- int idx = host.indexOf(QStringLiteral(":"));
+ int idx = host.lastIndexOf(QStringLiteral(":"));
bool ok = false;
int port = 0;
if (idx != -1) {