1
0
Fork 0
forked from svrjs/svrjs

Fix the regular expression in the URL parser

This commit is contained in:
Dorian Niemiec 2024-08-28 21:45:36 +02:00
parent a33a86ee62
commit 9fa194b33d

View file

@ -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