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

Unified Diff: components/data_reduction_proxy/common/data_reduction_proxy_headers.cc

Issue 338483002: Chrome Participated Tamper Detect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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/common/data_reduction_proxy_headers.cc
diff --git a/components/data_reduction_proxy/common/data_reduction_proxy_headers.cc b/components/data_reduction_proxy/common/data_reduction_proxy_headers.cc
index 773d14c7042f1443b5c757196c84bec974f702cd..e48afc366876e3aed082e133548044b45713a1f2 100644
--- a/components/data_reduction_proxy/common/data_reduction_proxy_headers.cc
+++ b/components/data_reduction_proxy/common/data_reduction_proxy_headers.cc
@@ -20,6 +20,9 @@ using net::ProxyService;
namespace data_reduction_proxy {
+const char* kDataReductionProxyViaValues[] = {"Chrome-Compression-Proxy",
bengr 2014/07/11 18:22:49 I don't know why you added this here, but make the
bengr 2014/07/11 18:22:49 Also, move this into an anonymous namespace.
+ "Chrome Compression Proxy"};
+
bool GetDataReductionProxyBypassDuration(
const net::HttpResponseHeaders* headers,
const std::string& action_prefix,
@@ -78,8 +81,7 @@ bool GetDataReductionProxyInfo(const net::HttpResponseHeaders* headers,
bool HasDataReductionProxyViaHeader(const net::HttpResponseHeaders* headers) {
const size_t kVersionSize = 4;
- const char kDataReductionProxyViaValue[] = "Chrome-Compression-Proxy";
- size_t value_len = strlen(kDataReductionProxyViaValue);
+ size_t value_len = strlen(kDataReductionProxyViaValues[0]);
void* iter = NULL;
std::string value;
@@ -88,7 +90,8 @@ bool HasDataReductionProxyViaHeader(const net::HttpResponseHeaders* headers) {
// 'Via: 1.1 Chrome-Compression-Proxy'
while (headers->EnumerateHeader(&iter, "via", &value)) {
if (value.size() >= kVersionSize + value_len &&
- !value.compare(kVersionSize, value_len, kDataReductionProxyViaValue))
+ !value.compare(kVersionSize, value_len,
+ kDataReductionProxyViaValues[0]))
return true;
}

Powered by Google App Engine
This is Rietveld 408576698