Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.3.0, 5.3.1
-
None
-
MacOSX, Windows, Linux
-
ea22c846b285ee4f71efc0fc050a4759880433a8
Description
QWebSocketServer will not accept incoming connection if HTTP headers are in lower case.
This is similar to problem that was already reported in QTBUG-37975 that concerned source file qwebsocket_p.cpp.
Similar problem is also in file qwebsockethandshakerequest.cpp.
QWebSocketHandshakeRequest::readHandshake method validates incoming HTTP connection and like in bug 37975 it first collects headers in QMap<QString,QString> and then uses string literal keys to check expected values - case-sensitive compare. On should ignore case in HTTP header keys.
A possible fix is to change line around line 229 in qwebsockethandshakerequest.cpp from
m_headers.insertMulti(headerField.at(0), headerField.at(1));
to
m_headers.insertMulti(headerField.at(0).toLower(), headerField.at(1));
and changing all string literals that act as keys to this m_headers (QMap) to be lower case.