| 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
|
| @@ -6,20 +6,21 @@
|
|
|
| #include <vector>
|
|
|
| #include "base/metrics/histogram_macros.h"
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/time/time.h"
|
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.h"
|
| #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"
|
| #include "net/proxy/proxy_info.h"
|
| #include "net/proxy/proxy_list.h"
|
| #include "net/proxy/proxy_retry_info.h"
|
| #include "net/proxy/proxy_server.h"
|
| #include "net/proxy/proxy_service.h"
|
| #include "net/url_request/url_request.h"
|
| #include "net/url_request/url_request_context.h"
|
| @@ -160,28 +161,14 @@ bool DataReductionProxyBypassProtocol::MaybeBypassProxyAndPrepareToRetry(
|
| data_reduction_proxy_info->bypass_all,
|
| data_reduction_proxy_type_info.proxy_servers);
|
| } else {
|
| request->SetLoadFlags(request->load_flags() |
|
| net::LOAD_DISABLE_CACHE |
|
| net::LOAD_BYPASS_PROXY);
|
| }
|
|
|
| // 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
|
|
|