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

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

Issue 2001243002: Change POST-exclusion to idempotent-inclusion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing unneeded header, streamlining method 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_delegate.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc
index d1e9a4dce6f960cad651a80f67da19efd15a7d57..99b2951abc6120ff1c43e293ea927ad3eaa8ebdd 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc
@@ -7,20 +7,21 @@
#include <cmath>
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.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/browser/data_reduction_proxy_configurator.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_event_creator.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/host_port_pair.h"
#include "net/base/url_util.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/proxy/proxy_server.h"
#include "net/proxy/proxy_service.h"
namespace data_reduction_proxy {
DataReductionProxyDelegate::DataReductionProxyDelegate(
@@ -112,21 +113,21 @@ void OnResolveProxyHandler(const GURL& url,
const net::ProxyRetryInfoMap& proxy_retry_info,
const DataReductionProxyConfig* config,
net::ProxyInfo* result) {
DCHECK(config);
DCHECK(result->is_empty() || result->is_direct() ||
!config->IsDataReductionProxy(result->proxy_server().host_port_pair(),
NULL));
bool data_saver_proxy_used = true;
if (result->is_empty() || !result->proxy_server().is_direct() ||
result->proxy_list().size() != 1 || url.SchemeIsWSOrWSS() ||
- method == "POST") {
+ !IsMethodIdempotent(method)) {
return;
}
if (data_reduction_proxy_config.is_valid()) {
net::ProxyInfo data_reduction_proxy_info;
data_reduction_proxy_config.proxy_rules().Apply(url,
&data_reduction_proxy_info);
data_reduction_proxy_info.DeprioritizeBadProxies(proxy_retry_info);
if (!data_reduction_proxy_info.proxy_server().is_direct())
result->OverrideProxyList(data_reduction_proxy_info.proxy_list());

Powered by Google App Engine
This is Rietveld 408576698