Skip to content
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/publicsuffix: check for label in EffectiveTLDPlusOne #30652

Closed
dcarriger opened this issue Mar 7, 2019 · 3 comments
Closed

x/net/publicsuffix: check for label in EffectiveTLDPlusOne #30652

dcarriger opened this issue Mar 7, 2019 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@dcarriger
Copy link

dcarriger commented Mar 7, 2019

What version of Go are you using (go version)?

$ go version
go version go1.12 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

baseDomain, err := publicsuffix.EffectiveTLDPlusOne(".com.au")
fmt.Println(baseDomain, err)

What did you see?

.com.au 

What did you expect to see?

If the label is empty, I should get an error message indicating such.

@gopherbot gopherbot added this to the Unreleased milestone Mar 7, 2019
@bcmills
Copy link
Contributor

bcmills commented Apr 12, 2019

CC @nigeltao @vdobler

@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 12, 2019
@vdobler
Copy link
Contributor

vdobler commented Apr 16, 2019

Currently the main function PublicSuffix requires its argument to be in a certain form:

  • domain name
  • lowercase
  • punicoded
  • not full qualified

(from memory, not authoritative) and will happily apply its algorithm even to inputs in a different form. This problem is addressed in the TODO in https://github.com/golang/net/blob/master/publicsuffix/list.go#L47

This issue here belongs a bit into this category because PublicSuffix(".com.au") == "com.au", true but ".com.au" is not a domain name at all. It is like PublicSuffix("123.45.67.89")) == "89", false yielding EffectiveTLDPlusOne("123.45.67.89") == "67.89", nil which is nonsensical too.

But the problem here might be worth a error message.

@gopherbot
Copy link

Change https://golang.org/cl/172537 mentions this issue: publicsuffix: domain labels may not be empty

@golang golang locked and limited conversation to collaborators Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants