HTTP parser: allowing tabs in field values as per RFC 7230.

This commit is contained in:
Valentin Bartenev
2018-03-15 21:07:57 +03:00
parent 3d2f85d9ca
commit 0b628bfe48
2 changed files with 45 additions and 13 deletions

View File

@@ -268,6 +268,18 @@ static nxt_http_parse_test_case_t nxt_http_test_cases[] = {
NXT_HTTP_PARSE_INVALID,
NULL, { NULL }
},
{
nxt_string("GET / HTTP/1.1\r\n"
"Ho\nst: example.com\r\n\r\n"),
NXT_HTTP_PARSE_INVALID,
NULL, { NULL }
},
{
nxt_string("GET / HTTP/1.1\r\n"
"Host : example.com\r\n\r\n"),
NXT_HTTP_PARSE_INVALID,
NULL, { NULL }
},
{
nxt_string("GET / HTTP/1.1\r\n"
"Host: exa\0mple.com\r\n\r\n"),
@@ -298,6 +310,18 @@ static nxt_http_parse_test_case_t nxt_http_test_cases[] = {
NXT_DONE,
NULL, { NULL }
},
{
nxt_string("GET / HTTP/1.1\r\n"
"Host: exa\nmple.com\r\n\r\n"),
NXT_HTTP_PARSE_INVALID,
NULL, { NULL }
},
{
nxt_string("GET / HTTP/1.1\r\n"
"Host: exa\tmple.com\r\n\r\n"),
NXT_DONE,
NULL, { NULL }
},
{
nxt_string("GET / HTTP/1.1\r\n"
"X-Unknown-Header: value\r\n"