net: JoinHostPort should not enclose non-IP literals in square brackets #18059
Labels
Milestone
Comments
@mikioh Sorry this may sound stupid. How do we identify non-IP literal? both "::1%lo0", "localhost%lo0" seems to be invalid. |
@mikioh got it. "localhost" is not a valid ipv6 address. |
CL https://golang.org/cl/40510 mentions this issue. |
gopherbot
pushed a commit
that referenced
this issue
Jun 14, 2017
…docs Updates #18059 Updates #20587 Change-Id: Icbb4c7cb201ac51d2cc6066620b47ba09ff6fe65 Reviewed-on: https://go-review.googlesource.com/45780 Reviewed-by: Chris Broadfoot <cbro@golang.org>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Looks like I forgot to add a test case. As per https://tools.ietf.org/html/rfc4007 (and considering https://tools.ietf.org/html/rfc6874 for the interoperability of the output of JoinHostPort), JoinHostPort should not enclose any non-IP literal in square brackets, and remove any scope zone identifier if necessary for avoiding ambiguity.
For example,
The text was updated successfully, but these errors were encountered: