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

Unified Diff: content/browser/appcache/appcache_update_job.cc

Issue 695193002: AppCacheUpdateJob allows data reduction proxy bypass redirects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698