forked from svrjs/svrjs
Fixed bug in the URL parser (URLs with "@" got erroneously "sanitized" to "/")
This commit is contained in:
parent
5781233ff7
commit
6933e3e9ed
1 changed files with 1 additions and 1 deletions
2
svr.js
2
svr.js
|
@ -1359,7 +1359,7 @@ function parseURL(uri, prepend) {
|
||||||
var hasSlashes = (uri.indexOf("/") != -1);
|
var hasSlashes = (uri.indexOf("/") != -1);
|
||||||
|
|
||||||
// Parse the URL using regular expression
|
// 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 1: protocol
|
||||||
// Match 2: slashes after protocol
|
// Match 2: slashes after protocol
|
||||||
// Match 3: authentication credentials
|
// Match 3: authentication credentials
|
||||||
|
|
Reference in a new issue