]> git.kaiwu.me - nginx.git/commitdiff
HTTP/2: finalize request as bad if parsing of pseudo-headers fails.
authorRuslan Ermilov <ru@nginx.com>
Tue, 30 Jan 2018 11:44:31 +0000 (14:44 +0300)
committerRuslan Ermilov <ru@nginx.com>
Tue, 30 Jan 2018 11:44:31 +0000 (14:44 +0300)
This is in line when the required pseudo-headers are missing, and
avoids spurious zero statuses in access.log.

src/http/v2/ngx_http_v2.c

index 8507eac268c58377a22e2ef4b8d2cf5b9d7b6a12..8c752db65bc5a57674ed490136e109946ab733aa 100644 (file)
@@ -1583,14 +1583,7 @@ ngx_http_v2_state_process_header(ngx_http_v2_connection_t *h2c, u_char *pos,
         }
 
         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;
         }