1
0
Fork 0
forked from svrjs/svrjs

Fix bug in the URL parser with href attribute of a parsed URL missing a port number.

This commit is contained in:
Dorian Niemiec 2024-08-23 18:03:55 +02:00
parent 0e722d8fcf
commit 52484dab24

2
svr.js
View file

@ -1418,7 +1418,7 @@ function parseURL(uri, prepend) {
}
if (parsedURI[8]) uobject.hash = parsedURI[8];
if (uobject.pathname) uobject.path = uobject.pathname + (uobject.search ? uobject.search : "");
uobject.href = (uobject.protocol ? (uobject.protocol + (uobject.slashes ? "//" : "")) : "") + (uobject.auth ? (uobject.auth + "@") : "") + (uobject.hostname ? uobject.hostname : "") + (uobject.path ? uobject.path : "") + (uobject.hash ? uobject.hash : "");
uobject.href = (uobject.protocol ? (uobject.protocol + (uobject.slashes ? "//" : "")) : "") + (uobject.auth ? (uobject.auth + "@") : "") + (uobject.hostname ? uobject.hostname : "") + (uobject.port ? ":" + uobject.port : "") + (uobject.path ? uobject.path : "") + (uobject.hash ? uobject.hash : "");
return uobject;
}