summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2023-03-10 06:47:53 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2023-03-10 06:47:53 +0300
commitff9e426337b84ed1d9ff3bbd17e7d7632c7ba19d (patch)
treefcc74e4b4903402ccd869a3ff21036d367e9702e
parent3c949f7c409e41a7c6fd6edb096281a3e82f85e4 (diff)
downloadnginx-ff9e426337b84ed1d9ff3bbd17e7d7632c7ba19d.tar.gz
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.
-rw-r--r--src/http/v2/ngx_http_v2.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c
index d32c03f10..ea3f27c07 100644
--- a/src/http/v2/ngx_http_v2.c
+++ b/src/http/v2/ngx_http_v2.c
@@ -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. */
if (ngx_http_v2_validate_header(r, header) != NGX_OK) {
- if (ngx_http_v2_terminate_stream(h2c, h2c->state.stream,
- NGX_HTTP_V2_PROTOCOL_ERROR)
- == NGX_ERROR)
- {
- return ngx_http_v2_connection_error(h2c,
- NGX_HTTP_V2_INTERNAL_ERROR);
- }
-
+ ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
goto error;
}