diff options
author | MÃ¥rten Nordheim <marten.nordheim@qt.io> | 2022-11-15 14:16:23 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-11-22 13:46:59 +0000 |
commit | d39f816b64f6036bbb9fc33d9565b429b3e0b56e (patch) | |
tree | d32090b86252eccb6645340ea50b0b75f0b7da59 /src/websockets/qwebsocket_p.cpp | |
parent | f9fe60653f6763bb165b05967f4b96e51a1615a1 (diff) | |
download | qtwebsockets-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.cpp | 2 |
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(", ")); } |