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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.cc

Issue 1135153002: Make DRP bypass logic apply to any proxies that send the DRP via header. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698