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

Root domain for externalUrls with country TLD #37

Open
josephguillaume opened this issue Oct 7, 2024 · 1 comment
Open

Root domain for externalUrls with country TLD #37

josephguillaume opened this issue Oct 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@josephguillaume
Copy link

Another very minor issue that I'm sharing for completeness, sorry!
Feel free to close as won't fix.

The code for parseRootDomain assumes a two part root domain

return parts.domain.split('.').slice(-2).join('.');

This breaks down e.g. for externalUrls with country TLD
e.g.
https://www.sbs.com.au/ondemand/movie/ten-canoes/11858499617 renders as "view at com.au"
https://iview.abc.net.au/show/imitation-game renders as "view at net.au"

A general solution seems non-trivial, but here's one that would be a relatively minor adjustment
https://github.com/capturr/get-root-domain/blob/main/src/index.ts

@NoelDeMartin
Copy link
Owner

Hm yeah, that definitely looks like a bug, I'll look into it next time I work on the project. Thanks for opening an issue :).

@NoelDeMartin NoelDeMartin added the bug Something isn't working label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants