Index: net/spdy/spdy_http_utils.cc |
diff --git a/net/spdy/spdy_http_utils.cc b/net/spdy/spdy_http_utils.cc |
index a3b7e54a96e433b817ed59bfeb7d2b1c582ed052..1575df72063ebc735cf963a9b62e36075e73d207 100644 |
--- a/net/spdy/spdy_http_utils.cc |
+++ b/net/spdy/spdy_http_utils.cc |
@@ -78,6 +78,7 @@ bool SpdyHeadersToHttpResponse(const spdy::SpdyHeaderBlock& headers, |
void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info, |
const HttpRequestHeaders& request_headers, |
spdy::SpdyHeaderBlock* headers, |
+ int protocol_version, |
bool direct) { |
HttpRequestHeaders::Iterator it(request_headers); |
@@ -98,14 +99,23 @@ void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info, |
} |
static const char kHttpProtocolVersion[] = "HTTP/1.1"; |
- (*headers)["version"] = kHttpProtocolVersion; |
- (*headers)["method"] = info.method; |
- (*headers)["host"] = GetHostAndOptionalPort(info.url); |
- (*headers)["scheme"] = info.url.scheme(); |
- if (direct) |
- (*headers)["url"] = HttpUtil::PathForRequest(info.url); |
- else |
- (*headers)["url"] = HttpUtil::SpecForRequest(info.url); |
+ if (protocol_version < 3) { |
+ (*headers)["version"] = kHttpProtocolVersion; |
+ (*headers)["method"] = info.method; |
+ (*headers)["host"] = GetHostAndOptionalPort(info.url); |
+ (*headers)["scheme"] = info.url.scheme(); |
+ if (direct) |
+ (*headers)["url"] = HttpUtil::PathForRequest(info.url); |
+ else |
+ (*headers)["url"] = HttpUtil::SpecForRequest(info.url); |
+ } else { |
+ (*headers)[":version"] = kHttpProtocolVersion; |
+ (*headers)[":method"] = info.method; |
+ (*headers)[":host"] = GetHostAndOptionalPort(info.url); |
+ (*headers)[":scheme"] = info.url.scheme(); |
+ (*headers)[":path"] = HttpUtil::PathForRequest(info.url); |
+ headers->erase("host"); // this is kinda insane, spdy 3 spec |
ramant (doing other things)
2012/03/15 05:41:34
nit: this -> This. Period at the end of sentence (
Ryan Hamilton
2012/03/15 16:38:06
Done.
|
+ } |
} |