| 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..5545d4d1aba644e5e8a702e8593f822949d02f55 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.
|
| + }
|
|
|
| }
|
|
|
|
|