1
0
Fork 0
forked from svrjs/svrjs

Fix URL parser even more

This commit is contained in:
Dorian Niemiec 2024-05-21 17:26:22 +02:00
parent 6933e3e9ed
commit 5942f9dbde

2
svr.js
View file

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