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

Unified Diff: net/http/http_request_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 | « no previous file | net/http/http_response_headers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_request_headers.cc
diff --git a/net/http/http_request_headers.cc b/net/http/http_request_headers.cc
index bf557df37b892db7c27e74de0c1f34b3af8e991f..8c9c42893361181f736d6c8699152ab1c2e87cdd 100644
--- a/net/http/http_request_headers.cc
+++ b/net/http/http_request_headers.cc
@@ -11,6 +11,18 @@
#include "base/values.h"
#include "net/http/http_util.h"
+namespace {
+
+bool ShouldShowHttpHeaderValue(const std::string& header_name) {
+#if defined(SPDY_PROXY_AUTH_ORIGIN)
+ if (header_name == "Proxy-Authorization")
+ return false;
+#endif
+ return true;
+}
+
+} // namespace
+
namespace net {
const char HttpRequestHeaders::kGetMethod[] = "GET";
@@ -191,10 +203,11 @@ base::Value* HttpRequestHeaders::NetLogCallback(
base::ListValue* headers = new base::ListValue();
for (HeaderVector::const_iterator it = headers_.begin();
it != headers_.end(); ++it) {
- headers->Append(
- new base::StringValue(base::StringPrintf("%s: %s",
- it->key.c_str(),
- it->value.c_str())));
+ headers->Append(new base::StringValue(
+ base::StringPrintf("%s: %s",
+ it->key.c_str(),
+ (ShouldShowHttpHeaderValue(it->key) ?
+ it->value.c_str() : "[elided]"))));
}
dict->Set("headers", headers);
return dict;
« no previous file with comments | « no previous file | net/http/http_response_headers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698