Skip to content

Report ICANN flags in tldts-icann and honor allowIcannDomains - #2756

Merged
remusao merged 1 commit into
masterfrom
icann-flags
Nov 12, 2026
Merged

remusao merged 1 commit into
masterfrom
icann-flags

Conversation

@remusao

@remusao remusao commented Nov 12, 2026

Copy link
Copy Markdown
Owner
  • Root cause: tldts-icann never wrote isIcann/isPrivate (every rule is ICANN, so it was skipped as redundant) and ignored allowIcannDomains. Only the shared fast path set flags, so example.com reported isIcann: true while example.fr and example.co.uk reported null, and { allowIcannDomains: false } still matched ICANN rules (co.uk, not uk).
  • Fix: a match is ICANN (isIcann true, isPrivate false), the '*' fallback is neither, and with allowIcannDomains off no rule can match. tldts-icann now returns exactly what tldts returns with private domains off.
  • Tests: the shared expectations no longer special-case tldts-icann.

- Root cause: tldts-icann never wrote isIcann/isPrivate (every rule is ICANN,
  so it was skipped as redundant) and ignored allowIcannDomains. Only the
  shared fast path set flags, so `example.com` reported isIcann: true while
  `example.fr` and `example.co.uk` reported null, and
  `{ allowIcannDomains: false }` still matched ICANN rules (co.uk, not uk).
- Fix: a match is ICANN (isIcann true, isPrivate false), the '*' fallback is
  neither, and with allowIcannDomains off no rule can match. tldts-icann now
  returns exactly what tldts returns with private domains off.
- Tests: the shared expectations no longer special-case tldts-icann.
@remusao remusao added the PR: Bug Fix 🐛 Increment patch version when merged label Nov 12, 2026
@remusao
remusao added this pull request to stack #2758 November 12, 2026 19:46
@remusao
remusao merged commit af27856 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: Bug Fix 🐛 Increment patch version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant