Closed weppos closed 7 years ago
This behavior was added to pass the test set for IDNA 2008 provided by the Unicode consortium. The same behavior is displayed here: http://www.unicode.org/cldr/utility/idna.jsp?a=..example.com. It is also consistent with the behavior of Chrome.
However, one could argue that dots should not be removed and/or that having leading dots is an error. Safari has this behavior.
I suggest making an option for this which is enabled in the Lookup profile, but disabled everywhere else. This would make the Punycode profile (used by idna.ToASCII) compatibly with the old behavior.
CL https://golang.org/cl/44380 mentions this issue.
CL https://golang.org/cl/44381 mentions this issue.
What version of Go are you using (
go version
)?go version go1.7.3 darwin/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
This issue is a follow up to #18567. The changes just committed in https://github.com/golang/net/commit/78ebe5c8b6a27ec13109c73c22193d618270e1e1 introduces again a compatibility error. I first discovered it thanks to the test failures in this PR: https://github.com/weppos/publicsuffix-go/pull/64
The issue is that a leading dot is stripped in the input. Here's a code to reproduce it:
WIth previous version:
With latest version:
In order to restore the previous functionality, I had to apply a terrible workaround: https://github.com/weppos/publicsuffix-go/pull/66 I'd appreciate suggestions on how to handle this case in a better way, if this bugfix is not going to land in net/idna.
What did you expect to see?
I'd expect the following string conversion:
What did you see instead?
/cc @mpvl @nigeltao