HTTP parser: fixed handling header fields with missing colon.
This commit is contained in:
@@ -482,7 +482,9 @@ name_end:
|
|||||||
return nxt_http_parse_field_value(rp, pos, end);
|
return nxt_http_parse_field_value(rp, pos, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
*pos = &p[i];
|
if (nxt_slow_path(i != 0)) {
|
||||||
|
return NXT_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
rp->field_name.length = 0;
|
rp->field_name.length = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -219,6 +219,18 @@ static nxt_http_parse_unit_test_case_t nxt_http_unit_test_cases[] = {
|
|||||||
NXT_DONE,
|
NXT_DONE,
|
||||||
NULL, { NULL }
|
NULL, { NULL }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
nxt_string("GET / HTTP/1.1\r\n"
|
||||||
|
"Host:\r\n\r\n"),
|
||||||
|
NXT_DONE,
|
||||||
|
NULL, { NULL }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
nxt_string("GET / HTTP/1.1\r\n"
|
||||||
|
"Host example.com\r\n\r\n"),
|
||||||
|
NXT_ERROR,
|
||||||
|
NULL, { NULL }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
nxt_string("GET / HTTP/1.1\r\n"
|
nxt_string("GET / HTTP/1.1\r\n"
|
||||||
":Host: example.com\r\n\r\n"),
|
":Host: example.com\r\n\r\n"),
|
||||||
|
|||||||
Reference in New Issue
Block a user