Checking Content-Length value right after header parse.

The check was moved from the request body read stage.
This commit is contained in:
Max Romanov
2020-03-12 17:54:19 +03:00
parent f3e6726098
commit 0b5aabfc3f
2 changed files with 8 additions and 6 deletions

View File

@@ -847,11 +847,6 @@ nxt_h1p_request_body_read(nxt_task_t *task, nxt_http_request_t *r)
goto ready;
}
if (r->content_length_n > (nxt_off_t) r->conf->socket_conf->max_body_size) {
status = NXT_HTTP_PAYLOAD_TOO_LARGE;
goto error;
}
body_length = (size_t) r->content_length_n;
b = r->body;