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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 if (m_clientProtocol.isEmpty()) { 541 if (m_clientProtocol.isEmpty()) {
542 m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-P rotocol mismatch"; 542 m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-P rotocol mismatch";
543 return false; 543 return false;
544 } 544 }
545 Vector<String> result; 545 Vector<String> result;
546 m_clientProtocol.split(String(WebSocket::subProtocolSeperator()), result ); 546 m_clientProtocol.split(String(WebSocket::subProtocolSeperator()), result );
547 if (!result.contains(serverWebSocketProtocol)) { 547 if (!result.contains(serverWebSocketProtocol)) {
548 m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-P rotocol mismatch"; 548 m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-P rotocol mismatch";
549 return false; 549 return false;
550 } 550 }
551 } else if (!m_clientProtocol.isEmpty()) {
552 m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-Proto col mismatch";
553 return false;
551 } 554 }
552 return true; 555 return true;
553 } 556 }
554 557
555 } // namespace WebCore 558 } // namespace WebCore
OLDNEW
« 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