-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Open
golang/text
#43Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
What did you do?
https://go.dev/play/p/oGhflDafvrL
package main
import (
"fmt"
"golang.org/x/net/idna"
)
func main() {
// Returns an error (as expected)
fmt.Println(idna.Registration.ToASCII("gólang.órg.."))
// Doesn't return an error
fmt.Println(idna.Registration.ToASCII("golang.org.."))
}
What did you expect to see?
xn--glang-0ta.xn--rg-4ja.. idna: invalid label ""
golang.org.. idna: invalid label ""
What did you see instead?
xn--glang-0ta.xn--rg-4ja.. idna: invalid label ""
golang.org.. <nil>
It appears if the domain contains an empty TLD label but contains only ASCII characters, then no error is returned. And only for the TLD (empty labels elsewhere return an error as expected).
Metadata
Metadata
Assignees
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.