Skip to content

Treat the parent of a wildcard rule as a public suffix - #2752

Merged
remusao merged 1 commit into
masterfrom
wildcard-implies-parent
Nov 12, 2026
Merged

remusao merged 1 commit into
masterfrom
wildcard-implies-parent

Conversation

@remusao

@remusao remusao commented Nov 12, 2026

Copy link
Copy Markdown
Owner
  • Root cause: tldts followed the PSL wiki's literal algorithm, where *.kobe.jp does not match kobe.jp: getDomain('kobe.jp') returned kobe.jp. Chromium, Firefox, libpsl, the PSL linter and tldts-experimental all treat *.p as implying p (The spec doesn't seem clear on how to handle "incomplete" hostnames publicsuffix/list#694), so tldts disagreed with browsers and with tldts-experimental on 292 hosts.
  • Fix (build time only): the parent of * gets the * rule's flag unless it already has one. Lookup code unchanged; tldts and tldts-icann data change.
  • Behaviour change: those 292 hosts become public suffixes (parse() returns the host as publicSuffix, domain null); bare wildcard TLDs such as er are now reported as ICANN.
  • Tests: wildcard parents in all option modes, builder tests, and a PSL check that fails if a node ever gets conflicting rule types or an exception sits under its own wildcard.

- Root cause: tldts followed the PSL wiki's literal algorithm, where `*.kobe.jp`
  does not match `kobe.jp`: `getDomain('kobe.jp')` returned `kobe.jp`. Chromium,
  Firefox, libpsl, the PSL linter and tldts-experimental all treat `*.p` as
  implying `p` (publicsuffix/list#694), so tldts disagreed with browsers and
  with tldts-experimental on 292 hosts.
- Fix (build time only): the parent of `*` gets the `*` rule's flag unless it
  already has one. Lookup code unchanged; tldts and tldts-icann data change.
- Behaviour change: those 292 hosts become public suffixes (`parse()` returns
  the host as `publicSuffix`, `domain` null); bare wildcard TLDs such as `er`
  are now reported as ICANN.
- Tests: wildcard parents in all option modes, builder tests, and a PSL check
  that fails if a node ever gets conflicting rule types or an exception sits
  under its own wildcard.
@remusao
remusao added this pull request to stack #2754 November 12, 2026 11:20
@remusao remusao added the PR: Polish 💅 Increment patch version when merged label Nov 12, 2026
@remusao
remusao merged commit ad50c08 into master Nov 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Polish 💅 Increment patch version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant