From 5942f9dbde51b0b18daaa30c1b9df7bec7871c1a Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Tue, 21 May 2024 17:26:22 +0200 Subject: [PATCH] Fix URL parser even more --- svr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svr.js b/svr.js index f614cee..75f6a63 100644 --- a/svr.js +++ b/svr.js @@ -1359,7 +1359,7 @@ function parseURL(uri, prepend) { var hasSlashes = (uri.indexOf("/") != -1); // Parse the URL using regular expression - var parsedURI = uri.match(/^(?:([^:]+:)(\/\/)?)?(?:([^@:\/?#\*]+)@)?([^:\/?#\*]+|\[[^\*]\/]\])?(?::([0-9]+))?(\*|\/[^?#]*)?(\?[^#]*)?(#[\S\s]*)?/); + var parsedURI = uri.match(/^(?:([^:]+:)(\/\/)?)?(?:([^@\/?#\*]+)@)?([^:\/?#\*]+|\[[^\*]\/]\])?(?::([0-9]+))?(\*|\/[^?#]*)?(\?[^#]*)?(#[\S\s]*)?/); // Match 1: protocol // Match 2: slashes after protocol // Match 3: authentication credentials