New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/net/idna: backward compatibility issues with change 2 #19821
Comments
See golang/go#19821 and failures in #64
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. 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. |
Dots are still removed for profiles for which this makes sense. Update golang/go#19821 Change-Id: I3de20bc5ddd943557831d1de998554105d7c07e7 Reviewed-on: https://go-review.googlesource.com/44380 Run-TryBot: Marcel van Lohuizen <mpvl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Nigel Tao <nigeltao@golang.org>
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 golang/net@78ebe5c introduces again a compatibility error. I first discovered it thanks to the test failures in this PR: weppos/publicsuffix-go#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: weppos/publicsuffix-go#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
The text was updated successfully, but these errors were encountered: