diff options
author | Valentin Bartenev <vbart@nginx.com> | 2019-09-17 18:40:21 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2019-09-17 18:40:21 +0300 |
commit | 6352c21a58d66db99f8f981c37e6d57e62fc24a2 (patch) | |
tree | 6c9c4a5bf510d5847b7f5667b8195bac79410b52 /src/test/nxt_http_parse_test.c | |
parent | 3b77e402a903d9f7a6eeb32f7930d8979f8e0c9e (diff) | |
download | unit-6352c21a58d66db99f8f981c37e6d57e62fc24a2.tar.gz unit-6352c21a58d66db99f8f981c37e6d57e62fc24a2.tar.bz2 |
HTTP parser: fixed parsing of target after literal space character.
In theory, all space characters in request target must be encoded; however,
some clients may violate the specification. For the sake of interoperability,
Unit supports unencoded space characters.
Previously, if there was a space character before the extension or arguments
parts, those parts weren't recognized. Also, quoted symbols and complex
target weren't detected after a space character.
Diffstat (limited to '')
-rw-r--r-- | src/test/nxt_http_parse_test.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/test/nxt_http_parse_test.c b/src/test/nxt_http_parse_test.c index 6fbda25a..5498cb1f 100644 --- a/src/test/nxt_http_parse_test.c +++ b/src/test/nxt_http_parse_test.c @@ -206,13 +206,26 @@ static nxt_http_parse_test_case_t nxt_http_test_cases[] = { }} }, { + nxt_string("GET /na %20me.ext?args HTTP/1.0\r\n\r\n"), + NXT_DONE, + &nxt_http_parse_test_request_line, + { .request_line = { + nxt_string("GET"), + nxt_string("/na %20me.ext?args"), + nxt_string("ext"), + nxt_string("args"), + "HTTP/1.0", + 0, 1, 1 + }} + }, + { nxt_string("GET / HTTP/1.0 HTTP/1.1\r\n\r\n"), NXT_DONE, &nxt_http_parse_test_request_line, { .request_line = { nxt_string("GET"), nxt_string("/ HTTP/1.0"), - nxt_null_string, + nxt_string("0"), nxt_null_string, "HTTP/1.1", 0, 0, 1 |