[PATCH] HTTP/2: reject HTTP/2 requests without ":scheme" pseudo-header

Piotr Sikora piotrsikora at google.com
Thu Mar 30 01:02:56 UTC 2017


# HG changeset patch
# User Piotr Sikora <piotrsikora at google.com>
# Date 1490516708 25200
#      Sun Mar 26 01:25:08 2017 -0700
# Node ID 970f063ddc7aa1faa646514418abd6a9b2eff889
# Parent  22be63bf21edaa1b8ea916c7d8cd4e5fe4892061
HTTP/2: reject HTTP/2 requests without ":scheme" pseudo-header.

Signed-off-by: Piotr Sikora <piotrsikora at google.com>

diff -r 22be63bf21ed -r 970f063ddc7a src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c
+++ b/src/http/v2/ngx_http_v2.c
@@ -3291,6 +3291,7 @@ ngx_http_v2_construct_request_line(ngx_h
     static const u_char ending[] = " HTTP/2.0";
 
     if (r->method_name.len == 0
+        || r->schema_start == NULL
         || r->unparsed_uri.len == 0)
     {
         ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);


More information about the nginx-devel mailing list