OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tools/quic/test_tools/quic_test_client.h" | 5 #include "net/tools/quic/test_tools/quic_test_client.h" |
6 | 6 |
7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
8 #include "net/base/completion_callback.h" | 8 #include "net/base/completion_callback.h" |
9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
10 #include "net/cert/cert_verify_result.h" | 10 #include "net/cert/cert_verify_result.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 if (headers != nullptr) { | 247 if (headers != nullptr) { |
248 SpdyHeaderBlock spdy_headers = | 248 SpdyHeaderBlock spdy_headers = |
249 SpdyBalsaUtils::RequestHeadersToSpdyHeaders(*headers); | 249 SpdyBalsaUtils::RequestHeadersToSpdyHeaders(*headers); |
250 if (headers->HasHeader("transfer-encoding")) { | 250 if (headers->HasHeader("transfer-encoding")) { |
251 // We have tests which rely on sending a non-standards-compliant | 251 // We have tests which rely on sending a non-standards-compliant |
252 // T-E header. | 252 // T-E header. |
253 string encoding; | 253 string encoding; |
254 headers->GetAllOfHeaderAsString("transfer-encoding", &encoding); | 254 headers->GetAllOfHeaderAsString("transfer-encoding", &encoding); |
255 spdy_headers.insert(std::make_pair("transfer-encoding", encoding)); | 255 spdy_headers.insert(std::make_pair("transfer-encoding", encoding)); |
256 } | 256 } |
| 257 if (static_cast<StringPiece>(spdy_headers[":authority"]).empty()) { |
| 258 // HTTP/2 requests should include the :authority pseudo hader. |
| 259 spdy_headers[":authority"] = client_->server_id().host(); |
| 260 } |
257 ret = stream->SendRequest(spdy_headers, body, fin); | 261 ret = stream->SendRequest(spdy_headers, body, fin); |
258 } else { | 262 } else { |
259 stream->SendBody(body.as_string(), fin, delegate); | 263 stream->SendBody(body.as_string(), fin, delegate); |
260 ret = body.length(); | 264 ret = body.length(); |
261 } | 265 } |
262 if (FLAGS_enable_quic_stateless_reject_support) { | 266 if (FLAGS_enable_quic_stateless_reject_support) { |
263 BalsaHeaders* new_headers = nullptr; | 267 BalsaHeaders* new_headers = nullptr; |
264 if (headers) { | 268 if (headers) { |
265 new_headers = new BalsaHeaders; | 269 new_headers = new BalsaHeaders; |
266 new_headers->CopyFrom(*headers); | 270 new_headers->CopyFrom(*headers); |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 message->headers()->SetRequestVersion( | 634 message->headers()->SetRequestVersion( |
631 HTTPMessage::VersionToString(HttpConstants::HTTP_1_1)); | 635 HTTPMessage::VersionToString(HttpConstants::HTTP_1_1)); |
632 message->headers()->SetRequestMethod( | 636 message->headers()->SetRequestMethod( |
633 HTTPMessage::MethodToString(HttpConstants::GET)); | 637 HTTPMessage::MethodToString(HttpConstants::GET)); |
634 message->headers()->SetRequestUri(uri); | 638 message->headers()->SetRequestUri(uri); |
635 } | 639 } |
636 | 640 |
637 } // namespace test | 641 } // namespace test |
638 } // namespace tools | 642 } // namespace tools |
639 } // namespace net | 643 } // namespace net |
OLD | NEW |