DescriptionAvoid 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. #
Messages
Total messages: 8 (2 generated)
|