summaryrefslogtreecommitdiff
path: root/src/websockets/qwebsocket_p.cpp
diff options
context:
space:
mode:
authorMÃ¥rten Nordheim <marten.nordheim@qt.io>2022-11-15 14:16:23 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-11-22 13:46:59 +0000
commitd39f816b64f6036bbb9fc33d9565b429b3e0b56e (patch)
treed32090b86252eccb6645340ea50b0b75f0b7da59 /src/websockets/qwebsocket_p.cpp
parentf9fe60653f6763bb165b05967f4b96e51a1615a1 (diff)
downloadqtwebsockets-d39f816b64f6036bbb9fc33d9565b429b3e0b56e.tar.gz
QWebSocket: check correct variable in if-statement
It's _usually_ correct, but if all protocols have been filtered out then it will be an empty string. Change-Id: I3aa3221b7e36cfd253cd1152b13e57183bf4f905 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 0fbd3decd0dd694063edd06a174f137ec30d3741) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/websockets/qwebsocket_p.cpp')
-rw-r--r--src/websockets/qwebsocket_p.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp
index 1539916..18efa59 100644
--- a/src/websockets/qwebsocket_p.cpp
+++ b/src/websockets/qwebsocket_p.cpp
@@ -1269,7 +1269,7 @@ QString QWebSocketPrivate::createHandShakeRequest(QString resourceName,
return validProtocols;
}();
- if (!protocols.isEmpty()) {
+ if (!validProtocols.isEmpty()) {
handshakeRequest << QStringLiteral("Sec-WebSocket-Protocol: ")
% validProtocols.join(QLatin1String(", "));
}