Welcome! Log In Create A New Profile

Advanced

[PATCH 2 of 2] HTTP/2: finalize request as bad if header validation fails

Maxim Dounin
February 22, 2023 07:56AM
# HG changeset patch
# User Maxim Dounin <mdounin@mdounin.ru>
# Date 1677070454 -10800
# Wed Feb 22 15:54:14 2023 +0300
# Node ID ec3819e66f40924efad183c291c850d9ccef16e7
# Parent 61bd779a868c4021c232dddfe7abda7e8ad32575
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.

diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c
--- 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_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

[PATCH 2 of 2] HTTP/2: finalize request as bad if header validation fails

Maxim Dounin 455 February 22, 2023 07:56AM

Re: [PATCH 2 of 2] HTTP/2: finalize request as bad if header validation fails

Roman Arutyunyan 107 March 08, 2023 09:16AM

Re: [PATCH 2 of 2] HTTP/2: finalize request as bad if header validation fails

Maxim Dounin 108 March 08, 2023 07:42PM

Re: [PATCH 2 of 2] HTTP/2: finalize request as bad if header validation fails

Roman Arutyunyan 119 March 09, 2023 05:50AM

Re: [PATCH 2 of 2] HTTP/2: finalize request as bad if header validation fails

Maxim Dounin 151 March 09, 2023 11:44PM



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

Online Users

Guests: 241
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