Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2562)

Unified Diff: Source/modules/websockets/WebSocketHandshake.cpp

Issue 22375002: WebSocket must not be established when subprotocol is not selected by the server (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix test description Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-null-subprotocol-selection_wsh.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/websockets/WebSocketHandshake.cpp
diff --git a/Source/modules/websockets/WebSocketHandshake.cpp b/Source/modules/websockets/WebSocketHandshake.cpp
index c2e1ca742af1d2e289d3cf2d3dbe0a44c59aefcb..46e8e9c78da9a8a3075f19da9639a409d9bc561e 100644
--- a/Source/modules/websockets/WebSocketHandshake.cpp
+++ b/Source/modules/websockets/WebSocketHandshake.cpp
@@ -548,6 +548,9 @@ bool WebSocketHandshake::checkResponseHeaders()
m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-Protocol mismatch";
return false;
}
+ } else if (!m_clientProtocol.isEmpty()) {
+ m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-Protocol mismatch";
+ return false;
}
return true;
}
« no previous file with comments | « LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-null-subprotocol-selection_wsh.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698