-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: separate CheckHyphens from ValidateLabel #41732
Comments
Change https://golang.org/cl/258837 mentions this issue: |
Thank you @TimothyGu. At Cloudflare some of our customers are seeing issues because of this that your change would allow us to fix. Let us know if we can be of any help. |
I've got a CL open: https://golang.org/cl/258837. It just needs to be reviewed. Ping @mpvl again. |
Okay, the x/text CL is in. We still need a x/net CL to sync the generated files with x/text. |
Change https://golang.org/cl/273586 mentions this issue: |
This copies CL 258837 from x/text over to this module. Fixes golang/go#41732. Change-Id: I41fc11c9a13faacb42504827063b60f7648426d2 Reviewed-on: https://go-review.googlesource.com/c/net/+/273586 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Nigel Tao <nigeltao@golang.org> Trust: Nigel Tao <nigeltao@golang.org> Trust: Cherry Zhang <cherryyz@google.com>
Thank you all! |
This aligns with the options in the latest version of UTS 46, and in particular allows implementing the WHATWG URL Standard. Fixes golang/go#41732. Change-Id: Iab577eff4303f3eea64512d07d968c891acf126f Reviewed-on: https://go-review.googlesource.com/c/text/+/258837 Reviewed-by: Marcel van Lohuizen <mpvl@golang.org> Reviewed-by: Nigel Tao <nigeltao@golang.org> Run-TryBot: Marcel van Lohuizen <mpvl@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Trust: Nigel Tao <nigeltao@golang.org>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Since UTS #46 version 10.0.0, ToASCII has had the CheckHyphens option to control checking for hyphens in the validation stage of IDNA conversion independently from other options. Indeed, the URL standard for web browsers simultaneously has these two requirements:
"https://al\u200Cp.com/"
"http://r2---sn-gvbxgn-tt1s.googlevideo.com/"
This behavior is seen in Node.js as well as WebKit-based browsers like Safari. Here's the output from Node.js:
However, x/net/idna does not allow controlling these two cases independently. When the ValidateLabels option is specified, the package would treat both as invalid; and if it's not specified, the package would treat both as valid: https://play.golang.org/p/O-nRi96pQH3
What did you expect to see?
x/net/idna should allow disabling hyphen checking independently of other label validation routines.
What did you see instead?
x/net/idna couples hyphen checking with other label validation routines.
The text was updated successfully, but these errors were encountered: