]> Cypherpunks repositories - gostls13.git/commit
net/url: disallow raw IPv6 addresses in host
authorSean Liao <sean@liao.dev>
Sat, 18 Oct 2025 09:31:12 +0000 (10:31 +0100)
committerSean Liao <sean@liao.dev>
Wed, 12 Nov 2025 18:02:50 +0000 (10:02 -0800)
commit0c28789bd7dfc55099cac86a3212dda0d6c091f6
treecb966d60f7fac8f9a2faff2ada7923616f6c295a
parent4e761b9a181a090ca9ec52916c4aef93c4cbc090
net/url: disallow raw IPv6 addresses in host

RFC 3986 requires square brackets around IPv6 addresses.
Parse's acceptance of raw IPv6 addresses is non compliant,
and complicates splitting out a port.

This is a resubmission of CL 710176 after the revert in CL 711800,
this time with a new urlstrictipv6 godebug to control the behavior.

Fixes #31024
Fixes #75223

Change-Id: I4cbe5bb84266b3efe9c98cf4300421ddf1df7291
Reviewed-on: https://go-review.googlesource.com/c/go/+/712840
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
doc/godebug.md
doc/next/6-stdlib/99-minor/net/url/31024.md [new file with mode: 0644]
src/internal/godebugs/table.go
src/net/url/url.go
src/net/url/url_test.go
src/runtime/metrics/doc.go