diff --git a/index.js b/index.js index 96e0431..34113f8 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,7 @@ const normalizeUrl = require('normalize-url'); const getUrlsFromQueryParams = url => { const ret = new Set(); - const {searchParams} = (new URL(url.replace(/^(\/\/|(www\.))/, 'http://$2'))); + const {searchParams} = (new URL(url.replace(/^(\/\/|(www\.))/i, 'http://$2'))); for (const [, value] of searchParams) { if (urlRegex({exact: true}).test(value)) { diff --git a/test.js b/test.js index 0e60165..127b9f5 100644 --- a/test.js +++ b/test.js @@ -130,3 +130,11 @@ test('requireSchemeOrWww turned off', t => { ]) ); }); + +test('supports upper case URL', t => { + const url = 'WWW.POS.COM'; + + t.notThrows(() => { + getUrls(url, {extractFromQueryString: true}); + }); +});