From 6933e3e9ed1a4384a1a4e5a4b7cd64fbb8d589e8 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Tue, 21 May 2024 17:08:06 +0200 Subject: [PATCH] Fixed bug in the URL parser (URLs with "@" got erroneously "sanitized" to "/") --- svr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svr.js b/svr.js index 05c4d5f..f614cee 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