diff options
author | bengr@chromium.org <bengr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-19 20:11:15 +0000 |
---|---|---|
committer | bengr@chromium.org <bengr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-19 20:11:15 +0000 |
commit | 136fb482c9371aee03641dcc840d8759bfb3339f (patch) | |
tree | c5fcf841277f9b1bb25fc70e2c43045b974d1535 /net/http/http_network_transaction.cc | |
parent | afe784128aad788994384a0215dd4c241c19b033 (diff) | |
download | chromium_src-136fb482c9371aee03641dcc840d8759bfb3339f.zip chromium_src-136fb482c9371aee03641dcc840d8759bfb3339f.tar.gz chromium_src-136fb482c9371aee03641dcc840d8759bfb3339f.tar.bz2 |
Retry idempotent methods on Chrome-Proxy: bypass
Requests using all idempotent HTTP methods (See RFC 2616) should be
retried after receiving a bypass message from the data reduction
proxy. Before this CL, only GET was being retried.
BUG=327740
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=241714
Review URL: https://codereview.chromium.org/99283006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241927 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_network_transaction.cc')
-rw-r--r-- | net/http/http_network_transaction.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index a6d5069..d956fb3 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -975,9 +975,9 @@ int HttpNetworkTransaction::DoReadHeadersComplete(int result) { else proxy_bypass_event = ProxyService::LONG_BYPASS; } else { - // Additionally, fallback if a 500 or 502 is returned via the data - // reduction proxy. This is conservative, as the 500 or 502 might have - // been generated by the origin, and not the proxy. + // Additionally, fallback if a 500, 502 or 503 is returned via the data + // reduction proxy. This is conservative, as the 500, 501 or 502 might + // have been generated by the origin, and not the proxy. if (response_.headers->response_code() == HTTP_INTERNAL_SERVER_ERROR || response_.headers->response_code() == HTTP_BAD_GATEWAY || response_.headers->response_code() == HTTP_SERVICE_UNAVAILABLE) { @@ -1008,9 +1008,14 @@ int HttpNetworkTransaction::DoReadHeadersComplete(int result) { chrome_proxy_info.bypass_duration, proxy_server, net_log_)) { - // Only retry in the case of GETs. We don't want to resubmit a POST + // Only retry idempotent methods. We don't want to resubmit a POST // if the proxy took some action. - if (request_->method == "GET") { + if (request_->method == "GET" || + request_->method == "OPTIONS" || + request_->method == "HEAD" || + request_->method == "PUT" || + request_->method == "DELETE" || + request_->method == "TRACE") { ResetConnectionAndRequestForResend(); return OK; } |