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

Unified Diff: net/http/http_network_transaction.cc

Issue 1014043004: Clear alternate protocols on empty or invalid header (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix in response to broken test Created 5 years, 9 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_network_transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction.cc
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 5ce7572496466d181cf48ea802549ee8eb70e2b7..199a5ff4d18e9a6a2fd17a562c2d49373f9f7126 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -79,7 +79,11 @@ void ProcessAlternateProtocol(
std::string alternate_protocol_str;
while (headers.EnumerateHeader(&iter, kAlternateProtocolHeader,
&alternate_protocol_str)) {
- alternate_protocol_values.push_back(alternate_protocol_str);
+ base::TrimWhitespaceASCII(alternate_protocol_str, base::TRIM_ALL,
+ &alternate_protocol_str);
+ if (!alternate_protocol_str.empty()) {
+ alternate_protocol_values.push_back(alternate_protocol_str);
+ }
}
session->http_stream_factory()->ProcessAlternateProtocol(
« no previous file with comments | « no previous file | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698