Stripping query for URL matching.

This commit is contained in:
DebaucheryLibrarian 2024-09-11 05:16:59 +02:00
parent d402916d5e
commit 96a041001b
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, {