| Index: net/http/http_proxy_client_socket.cc
|
| diff --git a/net/http/http_proxy_client_socket.cc b/net/http/http_proxy_client_socket.cc
|
| index 515301cf08c1f1b5c9ebb5451c913d434161d993..a7fd7fc8295ae985321c52284311a672c75f4b71 100644
|
| --- a/net/http/http_proxy_client_socket.cc
|
| +++ b/net/http/http_proxy_client_socket.cc
|
| @@ -483,25 +483,31 @@ int HttpProxyClientSocket::DoReadHeadersComplete(int result) {
|
| // sanitize the response. This still allows a rogue HTTPS proxy to
|
| // redirect an HTTPS site load to a similar-looking site, but no longer
|
| // allows it to impersonate the site the user requested.
|
| - if (is_https_proxy_ && SanitizeProxyRedirect(&response_, request_.url)) {
|
| + if (!is_https_proxy_ || !SanitizeProxyRedirect(&response_)) {
|
| + // We're not using an HTTPS proxy, or we couldn't sanitize the redirect.
|
| + LogBlockedTunnelResponse();
|
| + return ERR_TUNNEL_CONNECTION_FAILED;
|
| + }
|
| +
|
| + {
|
| bool is_connection_reused = http_stream_parser_->IsConnectionReused();
|
| redirect_has_load_timing_info_ =
|
| transport_->GetLoadTimingInfo(
|
| is_connection_reused, &redirect_load_timing_info_);
|
| - transport_.reset();
|
| - http_stream_parser_.reset();
|
| - return ERR_HTTPS_PROXY_TUNNEL_RESPONSE;
|
| }
|
| -
|
| - // We're not using an HTTPS proxy, or we couldn't sanitize the redirect.
|
| - LogBlockedTunnelResponse();
|
| - return ERR_TUNNEL_CONNECTION_FAILED;
|
| + transport_.reset();
|
| + http_stream_parser_.reset();
|
| + return ERR_HTTPS_PROXY_TUNNEL_RESPONSE;
|
|
|
| case 407: // Proxy Authentication Required
|
| // We need this status code to allow proxy authentication. Our
|
| // authentication code is smart enough to avoid being tricked by an
|
| // active network attacker.
|
| // The next state is intentionally not set as it should be STATE_NONE;
|
| + if (!SanitizeProxyAuth(&response_)) {
|
| + LogBlockedTunnelResponse();
|
| + return ERR_TUNNEL_CONNECTION_FAILED;
|
| + }
|
| return HandleProxyAuthChallenge(auth_.get(), &response_, net_log_);
|
|
|
| default:
|
|
|