]> git.kaiwu.me - nginx.git/commitdiff
HTTP/3: support $server_protocol variable.
authorRoman Arutyunyan <arut@nginx.com>
Tue, 14 Jul 2020 13:52:44 +0000 (16:52 +0300)
committerRoman Arutyunyan <arut@nginx.com>
Tue, 14 Jul 2020 13:52:44 +0000 (16:52 +0300)
Now it holds "HTTP/3.0".  Previously it was empty.

src/http/ngx_http_parse.c
src/http/ngx_http_request.c
src/http/v3/ngx_http_v3_request.c

index b59a6ce4c90808bcb8403dd40908553a3b2582f1..a351f2b27d3701f699dd5846a6456387867ea32a 100644 (file)
@@ -833,6 +833,10 @@ done:
         r->request_end = p;
     }
 
+    if (r->http_protocol.data) {
+        r->http_protocol.len = r->request_end - r->http_protocol.data;
+    }
+
     r->http_version = r->http_major * 1000 + r->http_minor;
     r->state = sw_start;
 
index 285879f2f8fc8e0e506395732f26d95254f14727..82deef674232a8393e2d10510a8ca5b5f2a56eb5 100644 (file)
@@ -1139,10 +1139,6 @@ ngx_http_process_request_line(ngx_event_t *rev)
             r->method_name.len = r->method_end - r->method_start;
             r->method_name.data = r->method_start;
 
-            if (r->http_protocol.data) {
-                r->http_protocol.len = r->request_end - r->http_protocol.data;
-            }
-
             if (ngx_http_process_request_uri(r) != NGX_OK) {
                 break;
             }
index af9cbd2b32493543c3850bfb7f3fdb22e9f2b1d6..adc40d3687e610bf13073b6ceeb3db30f416559a 100644 (file)
@@ -110,6 +110,8 @@ ngx_http_v3_parse_request(ngx_http_request_t *r, ngx_buf_t *b)
             continue;
         }
 
+        ngx_str_set(&r->http_protocol, "HTTP/3.0");
+
         len = (r->method_end - r->method_start) + 1
             + (r->uri_end - r->uri_start) + 1
             + sizeof("HTTP/3") - 1;