Changeset 112499 in webkit
- Timestamp:
- Mar 28, 2012 9:22:12 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r112490 r112499 1 2012-03-28 Li Yin <li.yin@intel.com> 2 3 [WebSocket]Browser must fail connection if Sec-WebSocket-Protocol mismatched. 4 https://bugs.webkit.org/show_bug.cgi?id=82307 5 6 Reviewed by Kent Tamura. 7 8 From RFC6455: http://tools.ietf.org/html/rfc6455#section-4.1 9 If the response includes a |Sec-WebSocket-Protocol| header field 10 and this header field indicates the use of a subprotocol that was 11 not present in the client's handshake (the server has indicated a 12 subprotocol not requested by the client), the client MUST _Fail 13 the WebSocket Connection_. 14 15 * http/tests/websocket/tests/hybi/handshake-fail-by-mismatch-protocol-header-expected.txt: Added. 16 * http/tests/websocket/tests/hybi/handshake-fail-by-mismatch-protocol-header.html: Added. 17 * http/tests/websocket/tests/hybi/handshake-fail-by-mismatch-protocol-header_wsh.py: Added. 18 (web_socket_do_extra_handshake): 19 (web_socket_transfer_data): 20 1 21 2012-03-28 David Grogan <dgrogan@chromium.org> 2 22 -
trunk/Source/WebCore/ChangeLog
r112498 r112499 1 2012-03-28 Li Yin <li.yin@intel.com> 2 3 [WebSocket]Browser must fail connection if Sec-WebSocket-Protocol mismatched. 4 https://bugs.webkit.org/show_bug.cgi?id=82307 5 6 Reviewed by Kent Tamura. 7 8 From RFC6455: http://tools.ietf.org/html/rfc6455#section-4.1 9 If the WebSocket openhanding respond included the mismatched 10 Sec-WebSocket-Protocol header field, the client must fail the WebSocket Connection. 11 12 Test: http/tests/websocket/tests/hybi/handshake-fail-by-mismatch-protocol-header.html 13 14 * Modules/websockets/WebSocketHandshake.cpp: 15 (WebCore::WebSocketHandshake::checkResponseHeaders): 16 1 17 2012-03-28 Jessie Berlin <jberlin@apple.com> 2 18 -
trunk/Source/WebCore/Modules/websockets/WebSocket.cpp
r110037 r112499 146 146 { 147 147 return webSocketsAvailable; 148 } 149 150 const char* WebSocket::subProtocolSeperator() 151 { 152 return ", "; 148 153 } 149 154 … … 268 273 269 274 if (!protocols.isEmpty()) 270 protocolString = joinStrings(protocols, ", ");275 protocolString = joinStrings(protocols, subProtocolSeperator()); 271 276 } 272 277 -
trunk/Source/WebCore/Modules/websockets/WebSocket.h
r107769 r112499 54 54 static void setIsAvailable(bool); 55 55 static bool isAvailable(); 56 static const char* subProtocolSeperator(); 56 57 static PassRefPtr<WebSocket> create(ScriptExecutionContext*); 57 58 virtual ~WebSocket(); -
trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp
r112377 r112499 35 35 36 36 #include "WebSocketHandshake.h" 37 #include "WebSocket.h" 37 38 38 39 #include "Base64.h" … … 728 729 return false; 729 730 } 731 if (!serverWebSocketProtocol.isNull()) { 732 if (m_clientProtocol.isEmpty()) { 733 m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-Protocol mismatch"; 734 return false; 735 } 736 Vector<String> result; 737 m_clientProtocol.split(String(WebSocket::subProtocolSeperator()), result); 738 if (!result.contains(serverWebSocketProtocol)) { 739 m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-Protocol mismatch"; 740 return false; 741 } 742 } 730 743 } 731 744 return true;
Note: See TracChangeset
for help on using the changeset viewer.