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

getSubdomain/getDomain do not perform as expected for .er top level domains #78

Open
nmargaritis opened this issue Aug 30, 2016 · 5 comments
Labels

Comments

@nmargaritis
Copy link

nmargaritis commented Aug 30, 2016

Testing the following host "shop.google.er" will return an empty subdomain. For example,

tldjs.getSubdomain("shop.google.er"); // null
tldjs.getDomain("shop.google.er"); // shop.google.er
tldjs.isValid("shop.google.er"); // true
tldjs.tldExists("shop.google.er"); // true

Although the expected outcome would be to have a subdomain of shop and a domain of google.er.

@nmargaritis nmargaritis changed the title getSubdomain does not perform as expected for .er top level domains getSubdomain/getDomain do not perform as expected for .er top level domains Aug 30, 2016
@thom4parisot
Copy link
Owner

thom4parisot commented Sep 13, 2016

@nmargaritis from the publicsuffixlist, I see that er is declared as *.er.

The confusion lies in #25 where the rules are defined for cookie parsing – so technically speaking shop.google.er is not a valid subdomain for the er tld.

It is very likely to be addressed by adding/renaming methods to make them explicit in term of what they are trying to do.

Let me know if that addresses your concern.

@remusao
Copy link
Collaborator

remusao commented Oct 26, 2017

@nmargaritis @oncletom Should we close this issue, as this is expected behavior?

@nmargaritis
Copy link
Author

@remusao @oncletom For some reason i missed the initial reply. If this is the expected behaviour then to my understanding the function isValid should fail instead of returning true.

@remusao
Copy link
Collaborator

remusao commented Oct 26, 2017

@nmargaritis From what I understood, the rule from public suffix is *.er, which means that google.er is a valid public suffix, hence isValid returns true for shop.google.er.

@nmargaritis
Copy link
Author

@remusao Yes that is correct for google.er and .er public suffix but isValid is described as "Is the hostname valid according to the RFC". So it should fail for shop.google.er since it is not valid based on the spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants