Welcome! Log In Create A New Profile

Advanced

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

Roman Arutyunyan
March 13, 2023 09:00AM
details: https://hg.nginx.org/nginx/rev/9db24374123b
branches:
changeset: 8148:9db24374123b
user: Maxim Dounin <mdounin@mdounin.ru>
date: Fri Mar 10 06:47:53 2023 +0300
description:
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.

diffstat:

src/http/v2/ngx_http_v2.c | 9 +--------
1 files changed, 1 insertions(+), 8 deletions(-)

diffs (19 lines):

diff -r 72627f1cf09e -r 9db24374123b src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c Fri Mar 10 06:47:48 2023 +0300
+++ b/src/http/v2/ngx_http_v2.c Fri Mar 10 06:47:53 2023 +0300
@@ -1794,14 +1794,7 @@ ngx_http_v2_state_process_header(ngx_htt

/* 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;
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

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

Roman Arutyunyan 470 March 13, 2023 09:00AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 248
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready