-
Notifications
You must be signed in to change notification settings - Fork 55
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
Multiple subdomains wrongly identified as domain #111
Comments
@jonathanvandriessen, this is expected behavior since both of the following are public suffixes:
See https://publicsuffix.org/list/ for reference The domain as returned by |
Thanks for your reply @ctavan ! |
@jonathanvandriessen To add to the answer from @ctavan, if this is something blocking for your usage of the library, this could be solved by having a way to match only ICANN rules, ignoring the PRIVATE section of the suffix list (since the rules for I already have some POC on one of my branches to do something like that. If there is some interest for such feature, we could try to integrate it. |
@remusao it is blocking for my usage of the library indeed. Currently, I'm considering a workaround where I check where: FYI: My use case is the following: given a domain (could include subdomains), I'm trying to determine if I need to add www in front of it to make it a valid url. I add .www if the domain does not seem to have a subdomain. I'd be happy to test drive your solution! |
@remusao how about simply adding an additional |
@ctavan Agreed about not introducing a breaking change. Maybe we could, as you suggest, add a new method in the API + a new attribute in the result of |
Maybe something like the This issue is duplicated in #120 #117 #78 and appears to be the main part of the v3 API considerations in #124 |
Hi,
First of all, thank you for tldjs, great library!
When I call tldjs.getDomain() on the following urls, tldjs identifies the entire url (without the protocol) as the domain, and no subdomains (tldjs.getSubdomain() returns empty).
This are the examples I have that cause an issue:
http://bntp-assets.global.ssl.fastly.net/
http://cres-wpstatic.freetls.fastly.net/
http://r3engage-live.global.ssl.fastly.net/
http://ticket-magic-ember-herokuapp-com.global.ssl.fastly.net/
Thank you!
The text was updated successfully, but these errors were encountered: