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

Parsing domain with public suffix domains #2304

Closed
lukmil opened this issue Mar 12, 2025 · 2 comments
Closed

Parsing domain with public suffix domains #2304

lukmil opened this issue Mar 12, 2025 · 2 comments

Comments

@lukmil
Copy link

lukmil commented Mar 12, 2025

I'm trying to parse url: 'https://something.github.io',

github.io is in https://publicsuffix.org/list/public_suffix_list.dat

But I'm getting that domain is github.io and subdomain is something.

But it should be domain 'something.github.io' and subdomain empty

Image

Using latest 6.1.84 version

@remusao
Copy link
Owner

remusao commented Mar 26, 2025

Hi, you need to use the { allowPrivateDomains: true } option with parse(...) to enable the use of github.io and others which are part of the "PRIVATE" section of the public suffix list. More examples there: https://github.com/remusao/tldts/blob/master/packages/tldts/README.md#api

@lukmil
Copy link
Author

lukmil commented Mar 27, 2025

Indeed, somehow missed this! Thanks and closing

@lukmil lukmil closed this as completed Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants