Chromium Code Reviews| Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.cc |
| diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.cc |
| index b2260502ed8fb5cbe3004fe2764c9c3267b98850..3d942ff1ef3972b7763e7b6818c82434541ea6c1 100644 |
| --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.cc |
| +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.cc |
| @@ -90,13 +90,29 @@ bool DataReductionProxyBypassProtocol::MaybeBypassProxyAndPrepareToRetry( |
| // Empty implies either that the request was served from cache or that |
| // request was served directly from the origin. |
| + // TODO(sclittle): Add UMA to confirm that the |proxy_server| is never empty |
| + // when the response has the Data Reduction Proxy via header. |
| if (request->proxy_server().IsEmpty()) |
| return false; |
| DataReductionProxyTypeInfo data_reduction_proxy_type_info; |
| if (!config_->WasDataReductionProxyUsed(request, |
| &data_reduction_proxy_type_info)) { |
| - return false; |
| + if (!HasDataReductionProxyViaHeader(response_headers, nullptr)) |
| + return false; |
| + |
| + // If the |proxy_server| doesn't match any of the currently configured Data |
| + // Reduction Proxies, but it still has the Data Reduction Proxy via header, |
| + // then apply the bypass logic regardless. |
| + // TODO(sclittle): Add UMA to record how often this occurs, and remove this |
| + // workaround once http://crbug.com/476610 is fixed. |
| + data_reduction_proxy_type_info.proxy_servers.first = net::ProxyServer( |
| + net::ProxyServer::SCHEME_HTTPS, request->proxy_server()); |
| + data_reduction_proxy_type_info.proxy_servers.second = net::ProxyServer( |
| + net::ProxyServer::SCHEME_HTTP, request->proxy_server()); |
| + data_reduction_proxy_type_info.is_alternative = false; |
| + data_reduction_proxy_type_info.is_fallback = false; |
| + data_reduction_proxy_type_info.is_ssl = request->url().SchemeIsSecure(); |
|
jeremyim
2015/05/11 22:32:52
If there have been instances of HTTPS requests hit
sclittle
2015/05/11 22:44:11
True, but we don't support bypass for the HTTPS tu
|
| } |
| // TODO(bengr): Implement bypass for CONNECT tunnel. |
| if (data_reduction_proxy_type_info.is_ssl) |