From 20a9c01444e2d8feea83f9f43dcdbca99e5167ae Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Wed, 11 Sep 2024 05:16:55 +0200 Subject: [PATCH] Remove double slashes from URLs before matching. --- src/dissectLink.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dissectLink.js b/src/dissectLink.js index 13c1981..f755b20 100644 --- a/src/dissectLink.js +++ b/src/dissectLink.js @@ -62,7 +62,7 @@ module.exports = function dissectLink(url) { return acc; } - const match = host.pattern.match(url); + const match = host.pattern.match(url.replace(/(https?:\/\/)|(\/)+/g, '$1$2')); // remove double slashes if(match) { return Object.assign(match, {