]> Cypherpunks repositories - gostls13.git/commit
net/url: restrict :port checking to [ipv6]:port form
authorRuss Cox <rsc@golang.org>
Thu, 6 Aug 2015 01:22:10 +0000 (21:22 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 6 Aug 2015 02:55:03 +0000 (02:55 +0000)
commitfc22331ccd015cfdbae73abe72cb6f3e8e2415b9
tree3bb5bed9a1677f762f4460419b35019c920754de
parente38c801ad15aa1e6a23aa7c7862e81d4634a5066
net/url: restrict :port checking to [ipv6]:port form

Go 1.4 and earlier accepted mysql://x@y(z:123)/foo
and I don't see any compelling reason to break that.

The CL during Go 1.5 that broke this syntax was
trying to fix #11208 and was probably too aggressive.
I added a test case for #11208 to make sure that stays
fixed.

Relaxing the check did not re-break #11208 nor did
it cause any existing test to fail. I added a test for the
mysql://x@y(z:123)/foo syntax being preserved.

Fixes #12023.

Change-Id: I659d39f18c85111697732ad24b757169d69284fc
Reviewed-on: https://go-review.googlesource.com/13253
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
src/net/url/url.go
src/net/url/url_test.go