From 0b628bfe484d1262d37e5043cad9f7a326d0d5e4 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Thu, 15 Mar 2018 21:07:57 +0300 Subject: HTTP parser: allowing tabs in field values as per RFC 7230. --- src/test/nxt_http_parse_test.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/test/nxt_http_parse_test.c') diff --git a/src/test/nxt_http_parse_test.c b/src/test/nxt_http_parse_test.c index bc2e3a42..a23f27c3 100644 --- a/src/test/nxt_http_parse_test.c +++ b/src/test/nxt_http_parse_test.c @@ -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" -- cgit