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

Unified Diff: net/http/http_response_headers.cc

Issue 453483002: Escape non-ASCII response headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 | 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 e767ebb4fcd2900cb976b77a00ee828b3c4fd4b7..d8c710f6c5501a7d7340f1eacc745d2cb4356cda 100644
--- a/net/http/http_response_headers.cc
+++ b/net/http/http_response_headers.cc
@@ -1355,9 +1355,12 @@ base::Value* HttpResponseHeaders::NetLogCallback(
std::string value;
while (EnumerateHeaderLines(&iterator, &name, &value)) {
std::string log_value = ElideHeaderValueForNetLog(log_level, name, value);
+ std::string escaped_name = EscapeNonASCII(name);
+ std::string escaped_value = EscapeNonASCII(log_value);
headers->Append(
new base::StringValue(
- base::StringPrintf("%s: %s", name.c_str(), log_value.c_str())));
+ base::StringPrintf("%s: %s", escaped_name.c_str(),
davidben 2014/08/07 17:36:36 Header names and values are "supposed to be" treat
Elly Fong-Jones 2014/08/07 19:41:37 Acknowledged.
+ escaped_value.c_str())));
}
dict->Set("headers", headers);
return dict;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698