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
stripWWW strips domains too #38
Comments
Can you do a PR? |
Hello! If no one is working on it right now, I would like to try. It's my first attempt to contribute to another open source project :) |
Feel free. If not, I'll try to get to it sometime next week. |
Can you give me some more information about the bug?
and they passed the tests. |
The most important test case is listed above. Also, check out strip-www's test suite. |
I'm confused with the cases |
They don't have to be valid domains.. they test that invalid input isn't further invalidated. Also, "www" could be a local TLD. |
There's an edge case with stripping www subdomains with regexp:
will produce:
Because the regexp doesn't know how far the subdomain extends because it can't know how long the TLD extends (.com vs .co.uk) without a large library like parse-domain. Such a lib is fine for the server, but not for a browser build. |
Interesting - so the edge case of URLs like |
It gets worse:
produces:
Technically, the subdomain is "www.app", since there is structurally no sub-subdomain. As a result, there could theroetically be no "app.company.com" configured. |
This can be rectified with strip-www.
The text was updated successfully, but these errors were encountered: