Rejecting requests with invalid "Content-Length".

This commit is contained in:
Valentin Bartenev
2019-02-07 17:40:27 +03:00
parent d60fbc6d44
commit a2cbe890a1

View File

@@ -79,14 +79,20 @@ nxt_int_t
nxt_http_request_content_length(void *ctx, nxt_http_field_t *field,
uintptr_t data)
{
nxt_off_t n;
nxt_http_request_t *r;
r = ctx;
r->content_length = field;
r->content_length_n = nxt_off_t_parse(field->value, field->value_length);
n = nxt_off_t_parse(field->value, field->value_length);
if (nxt_fast_path(n >= 0)) {
r->content_length_n = n;
return NXT_OK;
}
return NXT_ERROR;
}