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

Unified Diff: net/http/http_response_headers.cc

Issue 149703005: Elide proxy authentication headers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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
« no previous file with comments | « net/http/http_request_headers.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_response_headers.cc
diff --git a/net/http/http_response_headers.cc b/net/http/http_response_headers.cc
index 52bdfd738dbe98b461e1c9c38827b7752dd28cb0..88017d0b93ecfb286c2a2503c3a94ef814a56bfb 100644
--- a/net/http/http_response_headers.cc
+++ b/net/http/http_response_headers.cc
@@ -113,6 +113,14 @@ void CheckDoesNotHaveEmbededNulls(const std::string& str) {
CHECK(str.find('\0') == std::string::npos);
}
+bool ShouldShowHttpHeaderValue(const std::string& header_name) {
+#if defined(SPDY_PROXY_AUTH_ORIGIN)
+ if (header_name == "Proxy-Authenticate")
+ return false;
+#endif
+ return true;
+}
+
} // namespace
const char HttpResponseHeaders::kContentRange[] = "Content-Range";
@@ -1311,9 +1319,11 @@ base::Value* HttpResponseHeaders::NetLogCallback(
std::string value;
while (EnumerateHeaderLines(&iterator, &name, &value)) {
headers->Append(
- new base::StringValue(base::StringPrintf("%s: %s",
- name.c_str(),
- value.c_str())));
+ new base::StringValue(
+ base::StringPrintf("%s: %s",
+ name.c_str(),
+ (ShouldShowHttpHeaderValue(name) ?
+ value.c_str() : "[elided]"))));
}
dict->Set("headers", headers);
return dict;
« no previous file with comments | « net/http/http_request_headers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698