[nginx] HTTP/2: finalize request as bad if parsing of pseudo-headers fails.

Ruslan Ermilov ru at nginx.com
Tue Jan 30 12:26:30 UTC 2018


details:   http://hg.nginx.org/nginx/rev/d5a535774861
branches:  
changeset: 7192:d5a535774861
user:      Ruslan Ermilov <ru at nginx.com>
date:      Tue Jan 30 14:44:31 2018 +0300
description:
HTTP/2: finalize request as bad if parsing of pseudo-headers fails.

This is in line when the required pseudo-headers are missing, and
avoids spurious zero statuses in access.log.

diffstat:

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

diffs (19 lines):

diff -r 61d276dcd493 -r d5a535774861 src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c	Mon Jan 29 16:06:33 2018 +0300
+++ b/src/http/v2/ngx_http_v2.c	Tue Jan 30 14:44:31 2018 +0300
@@ -1583,14 +1583,7 @@ ngx_http_v2_state_process_header(ngx_htt
         }
 
         if (rc == NGX_DECLINED) {
-            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;
         }
 


More information about the nginx-devel mailing list