From 5ed10d5a6fbcde3fa2ee720f9de89ab4f70463de Mon Sep 17 00:00:00 2001 From: RouxAntoine Date: Sun, 9 Jul 2023 11:52:48 +0200 Subject: [PATCH] fix: resolve bug with path prefix on server url Close Issue 1370 --- dist/index.js | 2 +- src/url-helper.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index b0db713..9c49f66 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2451,7 +2451,7 @@ function getFetchUrl(settings) { return `${user}@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`; } // "origin" is SCHEME://HOSTNAME[:PORT] - return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`; + return `${serviceUrl.origin}${serviceUrl.pathname}/${encodedOwner}/${encodedName}`; } function getServerUrl(url) { let resolvedUrl = process.env['GITHUB_SERVER_URL'] || 'https://github.com'; diff --git a/src/url-helper.ts b/src/url-helper.ts index 17a0842..4753693 100644 --- a/src/url-helper.ts +++ b/src/url-helper.ts @@ -17,7 +17,7 @@ export function getFetchUrl(settings: IGitSourceSettings): string { } // "origin" is SCHEME://HOSTNAME[:PORT] - return `${serviceUrl.origin}/${encodedOwner}/${encodedName}` + return `${serviceUrl.origin}${serviceUrl.pathname}/${encodedOwner}/${encodedName}` } export function getServerUrl(url?: string): URL {