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

Issue 889783002: Avoid WebSocket upgrade on network error. (Closed)

Created:
5 years, 10 months ago by Adam Rice
Modified:
5 years, 10 months ago
Reviewers:
yhirano
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid WebSocket upgrade on network error. In the event of network error, the WebSocket server response is not validated. However, some network errors are ignored higher up in the stack. For example, in HttpNetworkTransaction::DoReadHeadersComplete at http_network_transaction.cc:988, ERR_CONNECTION_CLOSED is converted to OK. To avoid this whole class of bugs, do not keep status code 101 (Switching Protocols) if there was a network error. It is changed to 503. The response headers that are displayed in devtools are copied before the change, so they will still retain the original status code. BUG=408061 TEST=net_unittests Committed: https://crrev.com/23c3f94ffbf774f240fbc52c08760b0e3d90964b Cr-Commit-Position: refs/heads/master@{#314136}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add braces to multi-line if statement. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -0 lines) Patch
A net/data/websocket/truncated-headers_wsh.py View 1 chunk +19 lines, -0 lines 0 comments Download
M net/websockets/websocket_basic_handshake_stream.cc View 1 2 chunks +12 lines, -0 lines 0 comments Download
M net/websockets/websocket_end_to_end_test.cc View 1 chunk +13 lines, -0 lines 0 comments Download
M net/websockets/websocket_stream_test.cc View 1 chunk +24 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
Adam Rice
5 years, 10 months ago (2015-01-30 02:26:23 UTC) #2
yhirano
lgtm https://codereview.chromium.org/889783002/diff/1/net/websockets/websocket_basic_handshake_stream.cc File net/websockets/websocket_basic_handshake_stream.cc (right): https://codereview.chromium.org/889783002/diff/1/net/websockets/websocket_basic_handshake_stream.cc#newcode665 net/websockets/websocket_basic_handshake_stream.cc:665: HTTP_SWITCHING_PROTOCOLS) [optional] This condition is not simple and ...
5 years, 10 months ago (2015-02-02 11:06:47 UTC) #3
Adam Rice
https://codereview.chromium.org/889783002/diff/1/net/websockets/websocket_basic_handshake_stream.cc File net/websockets/websocket_basic_handshake_stream.cc (right): https://codereview.chromium.org/889783002/diff/1/net/websockets/websocket_basic_handshake_stream.cc#newcode665 net/websockets/websocket_basic_handshake_stream.cc:665: HTTP_SWITCHING_PROTOCOLS) On 2015/02/02 11:06:47, yhirano wrote: > [optional] This ...
5 years, 10 months ago (2015-02-02 12:10:26 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/889783002/20001
5 years, 10 months ago (2015-02-02 12:11:27 UTC) #6
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 10 months ago (2015-02-02 13:35:42 UTC) #7
commit-bot: I haz the power
5 years, 10 months ago (2015-02-02 13:38:02 UTC) #8
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/23c3f94ffbf774f240fbc52c08760b0e3d90964b
Cr-Commit-Position: refs/heads/master@{#314136}

Powered by Google App Engine
This is Rietveld 408576698