HTTP/2: finalize request as bad if header validation fails.

Similarly to 7192:d5a535774861, this avoids spurious zero statuses
in access.log, and in line with other header-related errors.
This commit is contained in:
Maxim Dounin 2023-03-10 06:47:53 +03:00
parent 3c949f7c40
commit ff9e426337

View File

@ -1794,14 +1794,7 @@ ngx_http_v2_state_process_header(ngx_http_v2_connection_t *h2c, u_char *pos,
/* TODO Optimization: validate headers while parsing. */ /* TODO Optimization: validate headers while parsing. */
if (ngx_http_v2_validate_header(r, header) != NGX_OK) { if (ngx_http_v2_validate_header(r, header) != NGX_OK) {
if (ngx_http_v2_terminate_stream(h2c, h2c->state.stream, ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
NGX_HTTP_V2_PROTOCOL_ERROR)
== NGX_ERROR)
{
return ngx_http_v2_connection_error(h2c,
NGX_HTTP_V2_INTERNAL_ERROR);
}
goto error; goto error;
} }