aboutcode-org / aboutcode-org/python-publicsuffix2

pages.example.com suffix declaration causes get_tld('example.com') == 'example.com'

未關閉
#18 6 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
30
分支
16
PR 合併指標
30 天內沒有已合併 PR

描述

`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'`:

```python
Python 3.7.7 (default, Mar 14 2020, 02:39:38)
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from publicsuffix2 import PublicSuffixList
>>> 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
```

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。