getDomainFromUrl needs unit tests and is not working as expected.
Closed this issue · 2 comments
Abdul-Sen commented
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 commented
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.