]> git.kaiwu.me - nginx.git/commit
HTTP/3: fixed handling of :authority and Host with port.
authorRoman Arutyunyan <arut@nginx.com>
Thu, 26 Jun 2025 16:19:59 +0000 (20:19 +0400)
committerSergey Kandaurov <s.kandaurov@f5.com>
Tue, 23 Dec 2025 18:40:33 +0000 (22:40 +0400)
commitbbf65b6e87dfc7f3a42651a55406e214a783808c
tree03a81bb2bddc1967094677f3f87650041654a702
parenta5cfa096d26933b1789d86df8af9c12574c23cc5
HTTP/3: fixed handling of :authority and Host with port.

RFC 9114, Section 4.3.1. specifies a restriction for :authority and Host
coexistence in an HTTP/3 request:

: If both fields are present, they MUST contain the same value.

Previously, this restriction was correctly enforced only for portless
values.  When Host contained a port, the request failed as if :authority
and Host were different, regardless of :authority presence.

This happens because the value of r->headers_in.server used for :authority
has port stripped.  The fix is to use r->host_start / r->host_end instead.
src/http/v3/ngx_http_v3_request.c