Rejecting requests with invalid "Content-Length".
This commit is contained in:
@@ -79,14 +79,20 @@ nxt_int_t
|
|||||||
nxt_http_request_content_length(void *ctx, nxt_http_field_t *field,
|
nxt_http_request_content_length(void *ctx, nxt_http_field_t *field,
|
||||||
uintptr_t data)
|
uintptr_t data)
|
||||||
{
|
{
|
||||||
|
nxt_off_t n;
|
||||||
nxt_http_request_t *r;
|
nxt_http_request_t *r;
|
||||||
|
|
||||||
r = ctx;
|
r = ctx;
|
||||||
|
|
||||||
r->content_length = field;
|
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_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NXT_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user