Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pluknet
Copy link
Contributor

@pluknet pluknet commented Nov 6, 2025

This series has some additional changes compared to previously posted on https://mailman.nginx.org/pipermail/nginx-devel/2024-June/KLY6JC27JZLSWBIOF6DT2FDDPIMDWWYK.html, most notably changes to stream, some minor though important fixes, rebase after c8c7beb and its proposed simplification via the ngx_http_validate_host() interface change.

See updated tests on my local branch:
https://github.com/pluknet/nginx-tests/tree/host

@pluknet pluknet added this to the nginx-1.29.4 milestone Nov 6, 2025
@pluknet pluknet requested a review from arut November 6, 2025 10:13
@pluknet pluknet self-assigned this Nov 6, 2025
It is rewritten based on ngx_http_parse_request_line() to follow
RFC 3986 host ABNF.  Notably, the following is now restricted:
- a port subcomponent with invalid values
- IP literals with a trailing dot and/or missing closing bracket
@pluknet
Copy link
Contributor Author

pluknet commented Nov 13, 2025

Changes:

  • removed request line hardening, it ought to be some legacy basic parser we would rather not touch, the main work to validate host should go in ngx_http_validate_host(). (although host in request target absolute form has precedence over the host header), "HTTP/1.1 clients will only send them in requests to proxies")
  • removed DNS label host interpretation, historically we were quite liberal here, allowing various experiments, changing this may be not a good idea
  • as a result, ngx_http_validate_host() keeps different parsing rules, the patch series was simplified to follow just wide RFC 3986 syntax.
  • see https://github.com/pluknet/nginx-tests/tree/host for updated tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants