# HG changeset patch # User Roman Arutyunyan # Date 1594734764 -10800 # Node ID e334ca1b23ba6310979331122564c7b7687a5ee9 # Parent e533a352d1184c8052ef6c2555a67bf517e212c3 HTTP/3: support $server_protocol variable. Now it holds "HTTP/3.0". Previously it was empty. diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c --- a/src/http/ngx_http_parse.c +++ b/src/http/ngx_http_parse.c @@ -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; diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -1139,10 +1139,6 @@ ngx_http_process_request_line(ngx_event_ 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; } diff --git a/src/http/v3/ngx_http_v3_request.c b/src/http/v3/ngx_http_v3_request.c --- a/src/http/v3/ngx_http_v3_request.c +++ b/src/http/v3/ngx_http_v3_request.c @@ -110,6 +110,8 @@ ngx_http_v3_parse_request(ngx_http_reque 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;