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

Unified Diff: net/http/http_network_transaction.cc

Issue 10987043: Receiving Connection: Proxy-Bypass induces proxy fallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Suppress proxy fallback loops. Created 8 years, 2 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
Index: net/http/http_network_transaction.cc
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index dd538e27b7e6ba85016deb4b5d98f1280b863a19..df1d8fc3fcf4092987de24281fadf74d948effbf 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -862,6 +862,23 @@ int HttpNetworkTransaction::DoReadHeadersComplete(int result) {
}
DCHECK(response_.headers);
+ // Server-induced fallback is supported only if this is a PAC configured
+ // proxy. See: http://crbug.com/143712
+ if (response_.was_fetched_via_proxy && proxy_info_.did_use_pac_script()) {
+ if (response_.headers != NULL &&
+ response_.headers->HasHeaderValue("connection", "proxy-bypass")) {
+ ProxyService* proxy_service = session_->proxy_service();
+ if (proxy_service->MarkProxyAsBad(proxy_info_, net_log_)) {
+ // Only retry in the case of GETs. We don't want to resubmit a POST
+ // if the proxy took some action.
+ if (request_->method == "GET") {
+ ResetConnectionAndRequestForResend();
+ return OK;
+ }
+ }
+ }
+ }
+
// Like Net.HttpResponseCode, but only for MAIN_FRAME loads.
if (request_->load_flags & LOAD_MAIN_FRAME) {
const int response_code = response_.headers->response_code();

Powered by Google App Engine
This is Rietveld 408576698