Index: content/browser/appcache/appcache_update_job.cc |
diff --git a/content/browser/appcache/appcache_update_job.cc b/content/browser/appcache/appcache_update_job.cc |
index 088d939a6cef331338cc36536bf649f4ab7460e8..8aa2ca11fd03f58a97055b7d9c815a4a1ac31803 100644 |
--- a/content/browser/appcache/appcache_update_job.cc |
+++ b/content/browser/appcache/appcache_update_job.cc |
@@ -12,6 +12,7 @@ |
#include "base/strings/stringprintf.h" |
#include "content/browser/appcache/appcache_group.h" |
#include "content/browser/appcache/appcache_histograms.h" |
+#include "net/base/host_port_pair.h" |
#include "net/base/io_buffer.h" |
#include "net/base/load_flags.h" |
#include "net/base/net_errors.h" |
@@ -20,6 +21,17 @@ |
#include "net/http/http_response_headers.h" |
#include "net/url_request/url_request_context.h" |
+namespace { |
+bool IsDataReductionProxy(const net::HostPortPair& proxy_server) { |
+ if (proxy_server.Equals(net::HostPortPair("proxy.googlezip.net", 443)) || |
+ proxy_server.Equals(net::HostPortPair("compress.googlezip.net", 80)) || |
+ proxy_server.Equals(net::HostPortPair("proxy-dev.googlezip.net", 80))) { |
michaeln1
2014/11/03 23:11:12
i hope this isn't here for long
bengr
2014/11/03 23:48:32
Acknowledged.
|
+ return true; |
+ } |
+ return false; |
+} |
+} // namspace |
+ |
namespace content { |
static const int kBufferSize = 32768; |
@@ -144,6 +156,14 @@ void AppCacheUpdateJob::URLFetcher::OnReceivedRedirect( |
const net::RedirectInfo& redirect_info, |
bool* defer_redirect) { |
DCHECK(request_ == request); |
+ // TODO(bengr): Remove this special case logic when crbug.com/429505 is |
+ // resolved. Until then, the data reduction proxy client logic uses the |
+ // redirect mechanism to resend requests over a direct connection when |
+ // the proxy instructs it to do so. |
+ if ((request->load_flags() & net::LOAD_BYPASS_PROXY) && |
michaeln
2014/11/03 21:37:20
Is the 'redirect' to the same url in this case?
bengr
2014/11/03 22:58:24
Yes
michaeln1
2014/11/03 23:11:12
Can you add that info to the comment and it'd be g
bengr
2014/11/03 23:48:32
Done.
|
+ IsDataReductionProxy(request->proxy_server())) { |
+ return; |
+ } |
// Redirect is not allowed by the update process. |
job_->MadeProgress(); |
redirect_response_code_ = request->GetResponseCode(); |