From 9fa194b33db1432930ab40b6c9da852018699822 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Wed, 28 Aug 2024 21:45:36 +0200 Subject: [PATCH] Fix the regular expression in the URL parser --- src/utils/urlParser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/urlParser.js b/src/utils/urlParser.js index 6ab48bf..cdc4400 100644 --- a/src/utils/urlParser.js +++ b/src/utils/urlParser.js @@ -13,7 +13,7 @@ function parseURL(uri, prepend) { // Parse the URL using regular expression let parsedURI = uri.match( - /^(?:([^:]+:)(\/\/)?)?(?:([^@/?#*]+)@)?([^:/?#*]+|\[[^*]\/]\])?(?::([0-9]+))?(\*|\/[^?#]*)?(\?[^#]*)?(#[\S\s]*)?/, + /^(?:([^:]+:)(\/\/)?)?(?:([^@/?#*]+)@)?([^:/?#*]+|\[[^*\]/]\])?(?::([0-9]+))?(\*|\/[^?#]*)?(\?[^#]*)?(#[\S\s]*)?/, ); // Match 1: protocol // Match 2: slashes after protocol