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

Unified Diff: net/tools/quic/spdy_balsa_utils.cc

Issue 2407003003: 32.Refactoring in preparation for SpdyHeaderBlock cleanup. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/tools/quic/spdy_balsa_utils_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/spdy_balsa_utils.cc
diff --git a/net/tools/quic/spdy_balsa_utils.cc b/net/tools/quic/spdy_balsa_utils.cc
index e045af9225e0e2f76c320618e23fd95a05f7893d..37889a4ef9d28a2f148876619b19e590405b7fb6 100644
--- a/net/tools/quic/spdy_balsa_utils.cc
+++ b/net/tools/quic/spdy_balsa_utils.cc
@@ -271,9 +271,23 @@ SpdyHeaderBlock SpdyBalsaUtils::RequestHeadersToSpdyHeaders(
DCHECK(!host_and_port.empty());
DCHECK(!path.empty());
+ if (scheme.empty()) {
+ if (request_headers.HasHeader("Scheme")) {
+ request_headers.GetAllOfHeaderAsString("Scheme", &scheme);
+ } else {
+ // Requests must contain a :scheme header, and unless another scheme is
+ // detected, https is assumed.
+ scheme = "https";
+ }
+ }
+
SpdyHeaderBlock block;
PopulateHttp2RequestHeaderBlock(request_headers, scheme, host_and_port, path,
&block);
+
+ // If a "Scheme" header existed in request_headers, it would have been
+ // propagated to |block|.
+ block.erase("scheme");
return block;
}
« no previous file with comments | « no previous file | net/tools/quic/spdy_balsa_utils_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698