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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 const HttpResponseHeaders& headers, 72 const HttpResponseHeaders& headers,
73 const HostPortPair& http_host_port_pair) { 73 const HostPortPair& http_host_port_pair) {
74 if (!headers.HasHeader(kAlternateProtocolHeader)) 74 if (!headers.HasHeader(kAlternateProtocolHeader))
75 return; 75 return;
76 76
77 std::vector<std::string> alternate_protocol_values; 77 std::vector<std::string> alternate_protocol_values;
78 void* iter = NULL; 78 void* iter = NULL;
79 std::string alternate_protocol_str; 79 std::string alternate_protocol_str;
80 while (headers.EnumerateHeader(&iter, kAlternateProtocolHeader, 80 while (headers.EnumerateHeader(&iter, kAlternateProtocolHeader,
81 &alternate_protocol_str)) { 81 &alternate_protocol_str)) {
82 alternate_protocol_values.push_back(alternate_protocol_str); 82 base::TrimWhitespaceASCII(alternate_protocol_str, base::TRIM_ALL,
83 &alternate_protocol_str);
84 if (!alternate_protocol_str.empty()) {
85 alternate_protocol_values.push_back(alternate_protocol_str);
86 }
83 } 87 }
84 88
85 session->http_stream_factory()->ProcessAlternateProtocol( 89 session->http_stream_factory()->ProcessAlternateProtocol(
86 session->http_server_properties(), 90 session->http_server_properties(),
87 alternate_protocol_values, 91 alternate_protocol_values,
88 http_host_port_pair, 92 http_host_port_pair,
89 *session); 93 *session);
90 } 94 }
91 95
92 base::Value* NetLogSSLVersionFallbackCallback( 96 base::Value* NetLogSSLVersionFallbackCallback(
(...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, 1538 description = base::StringPrintf("Unknown state 0x%08X (%u)", state,
1535 state); 1539 state);
1536 break; 1540 break;
1537 } 1541 }
1538 return description; 1542 return description;
1539 } 1543 }
1540 1544
1541 #undef STATE_CASE 1545 #undef STATE_CASE
1542 1546
1543 } // namespace net 1547 } // namespace net
OLDNEW
« 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