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

Remove package same-origin with new method in misc #879

Closed
molant opened this issue Mar 13, 2018 · 0 comments
Closed

Remove package same-origin with new method in misc #879

molant opened this issue Mar 13, 2018 · 0 comments

Comments

@molant
Copy link
Member

molant commented Mar 13, 2018

We are using the package same-origin somewhere in the code. It's a bit outdated and the new WHATWG URL parser available in node 8 makes things a lot easier to verify if two urls have the same origin.

We need to:

  1. Create a new method under utils/misc: sameOrigin with something similar to the following:
export const sameOrigin(url1: string, url2: string): boolean {
  return (new URL(url1)).origin === (new URL(url2)).origin;
}
  1. Remove same-origin from the dependencies and use this method.

Original conversation

@molant molant mentioned this issue Mar 13, 2018
4 tasks
@sarvaje sarvaje self-assigned this Mar 22, 2018
sarvaje added a commit to sarvaje/hint that referenced this issue Mar 22, 2018
@alrra alrra closed this as completed in 7ca95d4 Mar 22, 2018
alrra pushed a commit that referenced this issue Mar 22, 2018
alrra pushed a commit that referenced this issue Mar 22, 2018
sarvaje added a commit to sarvaje/hint that referenced this issue Mar 23, 2018
sarvaje added a commit to sarvaje/hint that referenced this issue Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants