Stripping query for URL matching.

This commit is contained in:
ThePendulum 2023-06-05 04:16:48 +02:00
parent 135fb372f5
commit 0d2bc9024f
1 changed files with 3 additions and 1 deletions

View File

@ -118,7 +118,9 @@ module.exports = function dissectLink(url) {
return acc;
}
const match = host.pattern.match(url.replace(/(https?:\/\/)|(\/)+/g, '$1$2')); // remove double slashes
// const match = host.pattern.match(url.replace(/(https?:\/\/)|(\/)+/g, '$1$2')); // remove double slashes
const { origin, pathname } = new URL(url);
const match = host.pattern.match(`${origin}${pathname}`); // remove double slashes
if (match) {
return Object.assign(match, {