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

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

Issue 2403193003: Landing Recent QUIC changes until 9:41 AM, Oct 10, 2016 UTC-7 (Closed)
Patch Set: git cl format 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 | « net/tools/quic/quic_time_wait_list_manager_test.cc ('k') | 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..509b3f61c731b626fe71cb99881ea3a96c8449c0 100644
--- a/net/tools/quic/spdy_balsa_utils.cc
+++ b/net/tools/quic/spdy_balsa_utils.cc
@@ -267,13 +267,23 @@ SpdyHeaderBlock SpdyBalsaUtils::RequestHeadersToSpdyHeaders(
}
}
- DCHECK(!scheme.empty());
- 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 | « net/tools/quic/quic_time_wait_list_manager_test.cc ('k') | net/tools/quic/spdy_balsa_utils_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698