From 52484dab2432e7dd006648e6cf97dead7001e16d Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Fri, 23 Aug 2024 18:03:55 +0200 Subject: [PATCH] Fix bug in the URL parser with href attribute of a parsed URL missing a port number. --- svr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svr.js b/svr.js index 8509afb..61effb5 100644 --- a/svr.js +++ b/svr.js @@ -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; }