diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2022-11-15 14:12:34 +0100 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2022-11-24 09:39:00 +0000 |
commit | 69e2b30057003c0ed17c3478d60fea249546a168 (patch) | |
tree | 34f8b7bdc7d23e55bfa5a6ddda1b6ff781e599be /src/websockets/qwebsocket_wasm_p.cpp | |
parent | 0fbd3decd0dd694063edd06a174f137ec30d3741 (diff) |
QWebSocket: honor subprotocols specified with setRawHeader
We would error out with a ConnectionRejected if the server accepted
one of the protocols specified directly in the header since we
did not consider those at all.
Fixes: QTBUG-108276
Pick-to: 6.4
Change-Id: Ifbb316c9d4871fd764e03c74caefa10f5b757155
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/websockets/qwebsocket_wasm_p.cpp')
-rw-r--r-- | src/websockets/qwebsocket_wasm_p.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/websockets/qwebsocket_wasm_p.cpp b/src/websockets/qwebsocket_wasm_p.cpp index e0b2156..4255203 100644 --- a/src/websockets/qwebsocket_wasm_p.cpp +++ b/src/websockets/qwebsocket_wasm_p.cpp @@ -174,15 +174,8 @@ void QWebSocketPrivate::open(const QNetworkRequest &request, // required for some use cases like MQTT. // add user subprotocol options - QStringList protocols = handshakeOptions().subprotocols(); - + QStringList protocols = requestedSubProtocols(); QByteArray secProto; - if (request.hasRawHeader("Sec-WebSocket-Protocol")) { - secProto = request.rawHeader("Sec-WebSocket-Protocol"); - if (!protocols.contains(secProto)) { - protocols.append(QString::fromLatin1(secProto)); - } - } if (!protocols.isEmpty()) { // comma-separated list of protocol strings, no spaces secProto = protocols.join(QStringLiteral(",")).toLatin1(); |