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

Side by Side Diff: net/quic/core/spdy_utils.cc

Issue 2391103003: Landing Recent QUIC changes until 3:24 PM, Oct 01, 2016 UTC-4 (Closed)
Patch Set: Add new error code to quic_error_mapping.cc Created 4 years, 2 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 | « net/quic/core/quic_utils.cc ('k') | net/quic/test_tools/crypto_test_utils.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/quic/core/spdy_utils.h" 5 #include "net/quic/core/spdy_utils.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 DVLOG(1) << "Required key '" << kFinalOffsetHeaderKey << "' not present"; 106 DVLOG(1) << "Required key '" << kFinalOffsetHeaderKey << "' not present";
107 return false; 107 return false;
108 } 108 }
109 // The final offset header is no longer needed. 109 // The final offset header is no longer needed.
110 trailers->erase(it->first); 110 trailers->erase(it->first);
111 111
112 // Trailers must not have empty keys, and must not contain pseudo headers. 112 // Trailers must not have empty keys, and must not contain pseudo headers.
113 for (const auto& trailer : *trailers) { 113 for (const auto& trailer : *trailers) {
114 base::StringPiece key = trailer.first; 114 base::StringPiece key = trailer.first;
115 base::StringPiece value = trailer.second; 115 base::StringPiece value = trailer.second;
116 if (key.starts_with(":")) { 116 if (base::StartsWith(key, ":", base::CompareCase::INSENSITIVE_ASCII)) {
117 DVLOG(1) << "Trailers must not contain pseudo-header: '" << key << "','" 117 DVLOG(1) << "Trailers must not contain pseudo-header: '" << key << "','"
118 << value << "'."; 118 << value << "'.";
119 return false; 119 return false;
120 } 120 }
121 121
122 // TODO(rjshade): Check for other forbidden keys, following the HTTP/2 spec. 122 // TODO(rjshade): Check for other forbidden keys, following the HTTP/2 spec.
123 } 123 }
124 124
125 DVLOG(1) << "Successfully parsed Trailers."; 125 DVLOG(1) << "Successfully parsed Trailers.";
126 return true; 126 return true;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 pos = url.find("/", start); 250 pos = url.find("/", start);
251 if (pos == string::npos) { 251 if (pos == string::npos) {
252 return false; 252 return false;
253 } 253 }
254 (*headers)[":authority"] = url.substr(start, pos - start); 254 (*headers)[":authority"] = url.substr(start, pos - start);
255 (*headers)[":path"] = url.substr(pos); 255 (*headers)[":path"] = url.substr(pos);
256 return true; 256 return true;
257 } 257 }
258 258
259 } // namespace net 259 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_utils.cc ('k') | net/quic/test_tools/crypto_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698