From 9032ebb45a28deb57fef2928acd72fca25aabbef Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 11 Jul 2022 21:04:32 +0200 Subject: [PATCH 1/2] fix: use hostname instead of host --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 6e88fcd..98a46fa 100644 --- a/lib/index.js +++ b/lib/index.js @@ -42,7 +42,7 @@ function parsePath(url) { output.protocols = protocols(parsed) output.protocol = output.protocols[0] output.port = parsed.port - output.resource = parsed.host + output.resource = parsed.hostname output.user = parsed.username || "" output.password = parsed.password || "" output.pathname = parsed.pathname From 01b23dc123c6f2cdc1357eba22243c7b7324e4ea Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Tue, 12 Jul 2022 10:36:29 +0200 Subject: [PATCH 2/2] test: add test --- test/index.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/index.js b/test/index.js index 30f923f..04686b4 100644 --- a/test/index.js +++ b/test/index.js @@ -241,6 +241,20 @@ const INPUTS = [ , query: {} , search: "" } + ], [ + "https://github.com:89/org/repo.git" + , { + protocols: ["https"] + , protocol: "https" + , port: "89" + , resource: "github.com" + , user: "" + , pathname: "/org/repo.git" + , hash: "" + , href: "https://github.com:89/org/repo.git" + , query: {} + , search: "" + } ] ];