You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicsuffix2 mishandles the case where, given the declaration of some public suffix, all suffixes of that suffix are seen as their own TLDs. E.g., given the declaration of git-pages.rit.edu as a public suffix, get_tld('rit.edu') returns 'rit.edu', whereas it really should return 'edu':
Python3.7.7 (default, Mar142020, 02:39:38)
[Clang11.0.0 (clang-1100.0.33.17)] ondarwinType"help", "copyright", "credits"or"license"formoreinformation.
>>>frompublicsuffix2importPublicSuffixList>>>psl=PublicSuffixList()
>>>psl.get_tld("foo.git-pages.rit.edu")
'git-pages.rit.edu'# CORRECT>>>psl.get_tld("git-pages.rit.edu")
'git-pages.rit.edu'# WRONG, should be 'edu'>>>psl.get_tld("rit.edu")
'rit.edu'# WRONG, should be 'edu'>>>psl.get_tld("edu")
'edu'# CORRECT, but probably out of accident
Just to be clear, this problem is more general than just the git-pages.rit.edu suffix. It will happen with any suffix (here: git-pages.rit.edu) that is an indirect subdomain of another suffix (here: edu): any intermediate domains (here: rit.edu) will erroneously be recognized as their own TLD when really that other suffix (here: edu) should be returned as the TLD instead.
This ticket insists that the publicsuffix of rit.edu should be edu, and I am. So what should the publicsuffix of kobe.jp be? Our test insists that it should be "kobe.jp".
Activity
jmehnle commentedon Jul 15, 2020
I tried to understand the
_lookup_nodemethod and fix the issue to create a PR, but haven't been successful in the limited time I have right now.pombredanne commentedon Jul 16, 2020
@jmehnle Thanks for the report ! @hiratara @KnitCode what's your take on this case?
Here the PSL has this entry:
jmehnle commentedon Jul 16, 2020
Just to be clear, this problem is more general than just the
git-pages.rit.edusuffix. It will happen with any suffix (here:git-pages.rit.edu) that is an indirect subdomain of another suffix (here:edu): any intermediate domains (here:rit.edu) will erroneously be recognized as their own TLD when really that other suffix (here:edu) should be returned as the TLD instead.hiratara commentedon Jul 17, 2020
I think it's my fault. I made the same mistake with the rust library.
rushmorem/publicsuffix#24
I believe this behavior is correct. psl produces the same result.
hiratara commentedon Jul 18, 2020
We also have to consider with platform.sh problem .
This ticket insists that the publicsuffix of
rit.edushould beedu, and I am. So what should the publicsuffix ofkobe.jpbe? Our test insists that it should be"kobe.jp".Here is the result of
psl:I think it's a good idea to make the same result as the psl.
hiratara commentedon Jul 19, 2020
I`m trying to fix the issue with #19 .