diff options
-rw-r--r-- | net/flip/flip_network_transaction_unittest.cc | 42 | ||||
-rw-r--r-- | net/flip/flip_session.cc | 2 |
2 files changed, 26 insertions, 18 deletions
diff --git a/net/flip/flip_network_transaction_unittest.cc b/net/flip/flip_network_transaction_unittest.cc index 84e0e78..4f41063 100644 --- a/net/flip/flip_network_transaction_unittest.cc +++ b/net/flip/flip_network_transaction_unittest.cc @@ -147,15 +147,18 @@ TEST_F(FlipNetworkTransactionTest, Constructor) { TEST_F(FlipNetworkTransactionTest, Get) { static const unsigned char syn[] = { 0x80, 0x01, 0x00, 0x01, // header - 0x01, 0x00, 0x00, 0x30, // FIN, len + 0x01, 0x00, 0x00, 0x46, // FIN, len 0x00, 0x00, 0x00, 0x01, // stream id - 0xc0, 0x00, 0x00, 0x03, // 4 headers - 0x00, 0x06, 'm', 'e', 't', 'h', 'o', 'd', // "hello" - 0x00, 0x03, 'G', 'E', 'T', // "bye" - 0x00, 0x03, 'u', 'r', 'l', // "url" - 0x00, 0x01, '/', // "/" - 0x00, 0x07, 'v', 'e', 'r', 's', 'i', 'o', 'n', // "status" - 0x00, 0x08, 'H', 'T', 'T', 'P', '/', '1', '.', '1', // "200" + 0xc0, 0x00, 0x00, 0x04, // 4 headers + 0x00, 0x04, 'h', 'o', 's', 't', + 0x00, 0x0e, 'w', 'w', 'w', '.', 'g', 'o', 'o', 'g', 'l', 'e', + '.', 'c', 'o', 'm', + 0x00, 0x06, 'm', 'e', 't', 'h', 'o', 'd', + 0x00, 0x03, 'G', 'E', 'T', + 0x00, 0x03, 'u', 'r', 'l', + 0x00, 0x01, '/', + 0x00, 0x07, 'v', 'e', 'r', 's', 'i', 'o', 'n', + 0x00, 0x08, 'H', 'T', 'T', 'P', '/', '1', '.', '1', }; static const unsigned char syn_reply[] = { @@ -221,16 +224,19 @@ TEST_F(FlipNetworkTransactionTest, Post) { // TODO(mbelshe): Hook up the write validation. //static const unsigned char syn[] = { - // 0x80, 0x01, 0x00, 0x01, // header - // 0x00, 0x00, 0x00, 0x30, // FIN, len - // 0x00, 0x00, 0x00, 0x01, // stream id - // 0xc0, 0x00, 0x00, 0x03, // 4 headers - // 0x00, 0x06, 'm', 'e', 't', 'h', 'o', 'd', // "hello" - // 0x00, 0x03, 'G', 'E', 'T', // "bye" - // 0x00, 0x03, 'u', 'r', 'l', // "url" - // 0x00, 0x01, '/', // "/" - // 0x00, 0x07, 'v', 'e', 'r', 's', 'i', 'o', 'n', // "status" - // 0x00, 0x08, 'H', 'T', 'T', 'P', '/', '1', '.', '1', // "200" + // 0x80, 0x01, 0x00, 0x01, // header + // 0x01, 0x00, 0x00, 0x46, // FIN, len + // 0x00, 0x00, 0x00, 0x01, // stream id + // 0xc0, 0x00, 0x00, 0x04, // 4 headers + // 0x00, 0x04, 'h', 'o', 's', 't', + // 0x00, 0x0e, 'w', 'w', 'w', '.', 'g', 'o', 'o', 'g', 'l', 'e', + // '.', 'c', 'o', 'm', + // 0x00, 0x06, 'm', 'e', 't', 'h', 'o', 'd', + // 0x00, 0x03, 'G', 'E', 'T', + // 0x00, 0x03, 'u', 'r', 'l', + // 0x00, 0x01, '/', + // 0x00, 0x07, 'v', 'e', 'r', 's', 'i', 'o', 'n', + // 0x00, 0x08, 'H', 'T', 'T', 'P', '/', '1', '.', '1', //}; //static const unsigned char upload_frame[] = { diff --git a/net/flip/flip_session.cc b/net/flip/flip_session.cc index 70a4abe..c081c5d 100644 --- a/net/flip/flip_session.cc +++ b/net/flip/flip_session.cc @@ -12,6 +12,7 @@ #include "base/string_util.h" #include "net/base/bandwidth_metrics.h" #include "net/base/load_flags.h" +#include "net/base/net_util.h" #include "net/flip/flip_frame_builder.h" #include "net/flip/flip_protocol.h" #include "net/http/http_network_session.h" @@ -195,6 +196,7 @@ void CreateFlipHeadersFromHttpRequest( (*headers)["method"] = info->method; (*headers)["url"] = hack_url; (*headers)["version"] = kHttpProtocolVersion; + (*headers)["host"] = GetHostAndOptionalPort(info->url); if (info->user_agent.length()) (*headers)["user-agent"] = info->user_agent; if (!info->referrer.is_empty()) |