Skip to content

fix: keep IPv6 brackets in the http-to-https redirect - #272

Merged
umputun merged 1 commit into
masterfrom
fix-redirect-ipv6-host
Oct 31, 2026
Merged

umputun merged 1 commit into
masterfrom
fix-redirect-ipv6-host

Conversation

@umputun

@umputun umputun commented Oct 31, 2026

Copy link
Copy Markdown
Owner

the http-to-https redirect cut the Host at the first colon, so a request with Host [::1]:80 or [::1] was redirected to https://[/path. The host now comes from discovery.HostName, the same parse route matching uses since #271, and an IPv6 literal gets its brackets back: https://[::1]/path. Other hosts redirect as before.

Reproduced on a static-ssl build before and after the change, plus a table test for the Location header.

the redirect cut the Host at the first colon, so a request with Host
[::1]:80 or [::1] was sent to https://[/path. The host now comes from
discovery.HostName, the same parse route matching uses, and an IPv6
literal gets its brackets back.
Copilot AI balanced review requested due to automatic review settings October 31, 2026 08:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@umputun
umputun merged commit 5528c8d into master Oct 31, 2026
2 checks passed
@umputun
umputun deleted the fix-redirect-ipv6-host branch October 31, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants