summaryrefslogtreecommitdiffstats
path: root/net/flip
diff options
context:
space:
mode:
authormbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-10 01:35:06 +0000
committermbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-10 01:35:06 +0000
commit3dcc4fbf1857666dacb8b72182e95abba2a45bd1 (patch)
tree8252a666b9775c53fdfc7ff2e9063e60f5826f7c /net/flip
parent71c012ae753d7f428e83cd4866a5516fc8c58b82 (diff)
downloadchromium_src-3dcc4fbf1857666dacb8b72182e95abba2a45bd1.zip
chromium_src-3dcc4fbf1857666dacb8b72182e95abba2a45bd1.tar.gz
chromium_src-3dcc4fbf1857666dacb8b72182e95abba2a45bd1.tar.bz2
Switch chrome to requesting full-urls over FLIP rather than
URIs. This is so that the protocol (http/https) can be conveyed directly from the client. This makes the host header irrelevant. Will update the spec. Updated the unit tests to reflect the host header removal. TEST=flip_network_transaction_unittest.cc BUG=none Review URL: http://codereview.chromium.org/379011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31530 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/flip')
-rw-r--r--net/flip/flip_network_transaction_unittest.cc29
-rw-r--r--net/flip/flip_session.cc3
2 files changed, 14 insertions, 18 deletions
diff --git a/net/flip/flip_network_transaction_unittest.cc b/net/flip/flip_network_transaction_unittest.cc
index 69eb6c0..c60ccdb 100644
--- a/net/flip/flip_network_transaction_unittest.cc
+++ b/net/flip/flip_network_transaction_unittest.cc
@@ -197,16 +197,15 @@ TEST_F(FlipNetworkTransactionTest, Constructor) {
TEST_F(FlipNetworkTransactionTest, Get) {
static const unsigned char syn[] = {
0x80, 0x01, 0x00, 0x01, // header
- 0x01, 0x00, 0x00, 0x46, // FIN, len
+ 0x01, 0x00, 0x00, 0x45, // 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',
+ 0xc0, 0x00, 0x00, 0x03, // 4 headers
0x00, 0x06, 'm', 'e', 't', 'h', 'o', 'd',
0x00, 0x03, 'G', 'E', 'T',
0x00, 0x03, 'u', 'r', 'l',
- 0x00, 0x01, '/',
+ 0x00, 0x16, 'h', 't', 't', 'p', ':', '/', '/', 'w', 'w', 'w',
+ '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'c', 'o',
+ 'm', '/',
0x00, 0x07, 'v', 'e', 'r', 's', 'i', 'o', 'n',
0x00, 0x08, 'H', 'T', 'T', 'P', '/', '1', '.', '1',
};
@@ -278,13 +277,12 @@ TEST_F(FlipNetworkTransactionTest, Post) {
// 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, 0x16, 'h', 't', 't', 'p', ':', '/', '/', 'w', 'w', 'w',
+ // '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'c', 'o',
+ // 'm', '/',
// 0x00, 0x07, 'v', 'e', 'r', 's', 'i', 'o', 'n',
// 0x00, 0x08, 'H', 'T', 'T', 'P', '/', '1', '.', '1',
//};
@@ -377,16 +375,15 @@ TEST_F(FlipNetworkTransactionTest, ResponseWithoutSynReply) {
TEST_F(FlipNetworkTransactionTest, DISABLED_CancelledTransaction) {
static const unsigned char syn[] = {
0x80, 0x01, 0x00, 0x01, // header
- 0x01, 0x00, 0x00, 0x46, // FIN, len
+ 0x01, 0x00, 0x00, 0x45, // 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',
+ 0xc0, 0x00, 0x00, 0x03, // 4 headers
0x00, 0x06, 'm', 'e', 't', 'h', 'o', 'd',
0x00, 0x03, 'G', 'E', 'T',
0x00, 0x03, 'u', 'r', 'l',
- 0x00, 0x01, '/',
+ 0x00, 0x16, 'h', 't', 't', 'p', ':', '/', '/', 'w', 'w', 'w',
+ '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'c', 'o',
+ 'm', '/',
0x00, 0x07, 'v', 'e', 'r', 's', 'i', 'o', 'n',
0x00, 0x08, 'H', 'T', 'T', 'P', '/', '1', '.', '1',
};
diff --git a/net/flip/flip_session.cc b/net/flip/flip_session.cc
index 1f594eb..9e2ad0d 100644
--- a/net/flip/flip_session.cc
+++ b/net/flip/flip_session.cc
@@ -105,9 +105,8 @@ void CreateFlipHeadersFromHttpRequest(
}
(*headers)["method"] = info->method;
- (*headers)["url"] = info->url.PathForRequest();
+ (*headers)["url"] = info->url.spec();
(*headers)["version"] = kHttpProtocolVersion;
- (*headers)["host"] = GetHostAndOptionalPort(info->url);
if (info->user_agent.length())
(*headers)["user-agent"] = info->user_agent;
if (!info->referrer.is_empty())