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

getDomainFromUrl needs unit tests and is not working as expected. #14

Closed
Abdul-Sen opened this issue Oct 5, 2020 · 2 comments
Closed

Comments

@Abdul-Sen
Copy link
Contributor

Hi, I noticed that the getDomainFromUrl does not have unit tests and from my preliminary testing is not behaving as expected.

e.g on inputting https://www.google.com/ the returned value should be google.com but it in fact returns https://www.google.com.

I'd like to open this issue to start working on a PR that can reference this issue.

@bluepnume
Copy link
Collaborator

Hi @Abdul-Sen,

Thanks for taking this up! I agree this function is probably badly named. That said, we probably can not change the behavior at this point due to several other libraries depending on this. Right now this returns the full protocol+domain to be used in browser apis (like window.postMessage()) which expect both.

@Abdul-Sen
Copy link
Contributor Author

Oh thanks for clearing that up, makes much more sense. In any case I will go ahead and close this issue but continue to add more tests through #12

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