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

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

Issue 2013763003: Change POST-exclusion to idempotent-inclusion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 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
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 1d0349a0e2493849316fa649fc696a3ae8d89d9b..7b3220e0f8a96096e13d23e255054dafbd68c74a 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
@@ -13,6 +13,7 @@
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
+#include "components/data_reduction_proxy/core/common/data_reduction_proxy_util.h"
#include "net/base/load_flags.h"
#include "net/http/http_response_headers.h"
#include "net/proxy/proxy_config.h"
@@ -167,21 +168,7 @@ bool DataReductionProxyBypassProtocol::MaybeBypassProxyAndPrepareToRetry(
// Retry if block-once was specified or if method is idempotent.
return bypass_type == BYPASS_EVENT_TYPE_CURRENT ||
- IsRequestIdempotent(request);
-}
-
-// static
-bool DataReductionProxyBypassProtocol::IsRequestIdempotent(
- const net::URLRequest* request) {
- DCHECK(request);
- if (request->method() == "GET" ||
- request->method() == "OPTIONS" ||
- request->method() == "HEAD" ||
- request->method() == "PUT" ||
- request->method() == "DELETE" ||
- request->method() == "TRACE")
- return true;
- return false;
+ IsMethodIdempotent(request->method());
}
} // namespace data_reduction_proxy

Powered by Google App Engine
This is Rietveld 408576698