diff options
Diffstat (limited to 'src/test/nxt_http_parse_test.c')
-rw-r--r-- | src/test/nxt_http_parse_test.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/test/nxt_http_parse_test.c b/src/test/nxt_http_parse_test.c index 572e91b2..3e86f6ef 100644 --- a/src/test/nxt_http_parse_test.c +++ b/src/test/nxt_http_parse_test.c @@ -80,7 +80,7 @@ static nxt_http_parse_test_case_t nxt_http_test_cases[] = { { .request_line = { nxt_string("XXX-METHOD"), nxt_string("/d.ir/fi+le.ext?key=val"), - nxt_string("ext?key=val"), + nxt_string("ext"), nxt_string("key=val"), "HTTP/1.2", 0, 0, 0, 1 @@ -163,7 +163,7 @@ static nxt_http_parse_test_case_t nxt_http_test_cases[] = { nxt_string("GET"), nxt_string("/?#"), nxt_null_string, - nxt_string("#"), + nxt_string(""), "HTTP/1.0", 1, 0, 0, 0 }} @@ -729,31 +729,23 @@ nxt_http_parse_test_request_line(nxt_http_request_parse_t *rp, return NXT_ERROR; } - str.length = (rp->exten_start != NULL) ? rp->target_end - rp->exten_start - : 0; - str.start = rp->exten_start; - - if (str.start != test->exten.start - && !nxt_strstr_eq(&str, &test->exten)) + if (rp->exten.start != test->exten.start + && !nxt_strstr_eq(&rp->exten, &test->exten)) { nxt_log_alert(log, "http parse test case failed:\n" " - request:\n\"%V\"\n" " - exten: \"%V\" (expected: \"%V\")", - request, &str, &test->exten); + request, &rp->exten, &test->exten); return NXT_ERROR; } - str.length = (rp->args_start != NULL) ? rp->target_end - rp->args_start - : 0; - str.start = rp->args_start; - - if (str.start != test->args.start - && !nxt_strstr_eq(&str, &test->args)) + if (rp->args.start != test->args.start + && !nxt_strstr_eq(&rp->args, &test->args)) { nxt_log_alert(log, "http parse test case failed:\n" " - request:\n\"%V\"\n" " - args: \"%V\" (expected: \"%V\")", - request, &str, &test->args); + request, &rp->args, &test->args); return NXT_ERROR; } |