-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
30 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,7 +177,7 @@ TEST(http1_parser, parses_req_uri) | |
#define TEST_URI_PATH(req_uri_path) \ | ||
FOR_REQ("GET " req_uri_path " HTTP/1.1\r\n\r\n") \ | ||
{ \ | ||
EXPECT_TFWSTR_EQ(&req->host, ""); \ | ||
EXPECT_TFWSTR_EQ(&req->h_tbl->tbl[TFW_HTTP_HDR_URI_HOST], "");\ | ||
EXPECT_TFWSTR_EQ(&req->uri_path, req_uri_path); \ | ||
} | ||
|
||
|
@@ -190,7 +190,7 @@ TEST(http1_parser, parses_req_uri) | |
#define TEST_FULL_REQ(req_host, req_uri_path) \ | ||
FOR_REQ("GET http://" req_host req_uri_path " HTTP/1.1\r\n\r\n")\ | ||
{ \ | ||
EXPECT_TFWSTR_EQ(&req->host, req_host); \ | ||
EXPECT_TFWSTR_EQ(&req->h_tbl->tbl[TFW_HTTP_HDR_URI_HOST], req_host);\ | ||
EXPECT_TFWSTR_EQ(&req->uri_path, req_uri_path); \ | ||
} | ||
|
||
|
@@ -207,22 +207,22 @@ TEST(http1_parser, parses_req_uri) | |
|
||
FOR_REQ("GET http://[email protected] HTTP/1.1\r\n\r\n") | ||
{ | ||
EXPECT_TFWSTR_EQ(&req->host, "natsys-lab.com"); | ||
EXPECT_TFWSTR_EQ(&req->h_tbl->tbl[TFW_HTTP_HDR_URI_HOST], "natsys-lab.com"); | ||
} | ||
|
||
FOR_REQ("GET https://[email protected] HTTP/1.1\r\n\r\n") | ||
{ | ||
EXPECT_TFWSTR_EQ(&req->host, "natsys-lab.com"); | ||
EXPECT_TFWSTR_EQ(&req->h_tbl->tbl[TFW_HTTP_HDR_URI_HOST], "natsys-lab.com"); | ||
} | ||
|
||
FOR_REQ("GET ws://[email protected] HTTP/1.1\r\n\r\n") | ||
{ | ||
EXPECT_TFWSTR_EQ(&req->host, "natsys-lab.com"); | ||
EXPECT_TFWSTR_EQ(&req->h_tbl->tbl[TFW_HTTP_HDR_URI_HOST], "natsys-lab.com"); | ||
} | ||
|
||
FOR_REQ("GET wss://[email protected] HTTP/1.1\r\n\r\n") | ||
{ | ||
EXPECT_TFWSTR_EQ(&req->host, "natsys-lab.com"); | ||
EXPECT_TFWSTR_EQ(&req->h_tbl->tbl[TFW_HTTP_HDR_URI_HOST], "natsys-lab.com"); | ||
} | ||
|
||
FOR_REQ("OPTIONS * HTTP/1.1\r\n\r\n"); | ||
|
@@ -262,7 +262,7 @@ TEST(http1_parser, parses_enforce_ext_req) | |
"Accept: */*\r\n" | ||
"\r\n") | ||
{ | ||
EXPECT_TFWSTR_EQ(&req->host, "natsys-lab.com"); | ||
EXPECT_TFWSTR_EQ(&req->h_tbl->tbl[TFW_HTTP_HDR_URI_HOST], "natsys-lab.com"); | ||
EXPECT_TFWSTR_EQ(&req->uri_path, "/"); | ||
} | ||
|
||
|
@@ -272,7 +272,7 @@ TEST(http1_parser, parses_enforce_ext_req) | |
"Accept: */*\r\n" | ||
"\r\n") | ||
{ | ||
EXPECT_TFWSTR_EQ(&req->host, "natsys-lab.com:8080"); | ||
EXPECT_TFWSTR_EQ(&req->h_tbl->tbl[TFW_HTTP_HDR_URI_HOST], "natsys-lab.com:8080"); | ||
EXPECT_TFWSTR_EQ(&req->uri_path, "/cgi-bin/show.pl"); | ||
} | ||
} | ||
|
@@ -320,19 +320,19 @@ TEST(http1_parser, parses_enforce_ext_req_rmark) | |
} | ||
|
||
FOR_REQ("GET " AUTH RMARK URI_1 " HTTP/1.1\r\n\r\n") { | ||
EXPECT_TFWSTR_EQ(&req->host, HOST ":" PORT); | ||
EXPECT_TFWSTR_EQ(&req->h_tbl->tbl[TFW_HTTP_HDR_URI_HOST], HOST ":" PORT); | ||
EXPECT_TFWSTR_EQ(&req->mark, RMARK); | ||
EXPECT_TFWSTR_EQ(&req->uri_path, URI_1); | ||
} | ||
|
||
FOR_REQ("GET " AUTH RMARK URI_3 " HTTP/1.1\r\n\r\n") { | ||
EXPECT_TFWSTR_EQ(&req->host, HOST ":" PORT); | ||
EXPECT_TFWSTR_EQ(&req->h_tbl->tbl[TFW_HTTP_HDR_URI_HOST], HOST ":" PORT); | ||
EXPECT_TFWSTR_EQ(&req->mark, RMARK); | ||
EXPECT_TFWSTR_EQ(&req->uri_path, URI_3); | ||
} | ||
|
||
FOR_REQ("GET " AUTH RMARK URI_4 " HTTP/1.1\r\n\r\n") { | ||
EXPECT_TFWSTR_EQ(&req->host, HOST ":" PORT); | ||
EXPECT_TFWSTR_EQ(&req->h_tbl->tbl[TFW_HTTP_HDR_URI_HOST], HOST ":" PORT); | ||
EXPECT_TFWSTR_EQ(&req->mark, RMARK); | ||
EXPECT_TFWSTR_EQ(&req->uri_path, URI_4); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters