mirror of
https://github.com/golang/go.git
synced 2025-12-07 13:50:04 +00:00
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>
286 B
286 B
[Parse] now rejects malformed URLs containing colons in the host subcomponent,
such as http://::1/ or http://localhost:80:80/.
URLs containing bracketed IPv6 addresses, such as http://[::1]/ are still accepted.
The new GODEBUG=urlstrictcolons=0 setting restores the old behavior.