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

Invalid URL: WWW.POS.COM #53

Closed
ganuonglachanh opened this issue Mar 1, 2020 · 1 comment · Fixed by #56
Closed

Invalid URL: WWW.POS.COM #53

ganuonglachanh opened this issue Mar 1, 2020 · 1 comment · Fixed by #56

Comments

@ganuonglachanh
Copy link

ganuonglachanh commented Mar 1, 2020

let url = 'WWW.POS.COM';
let test = getUrls(url,{extractFromQueryString: true});

getUrls failed with this error:
Invalid URL: WWW.POS.COM

in line 8:

const {searchParams} = (new URL(url.replace(/^(\/\/|(www\.))/, 'http://$2')));

solution:
add i in regex

const {searchParams} = (new URL(url.replace(/^(\/\/|(www\.))/i, 'http://$2')));

@sindresorhus
Copy link
Owner

PR welcome with a test.

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

Successfully merging a pull request may close this issue.

2 participants