Fix getGitHubGatewayConnectionDetails to use the correct hostname without any url paths

This commit is contained in:
Carlos Monastyrski
2026-01-07 20:52:38 -03:00
parent 815af3a892
commit ee24e55dd5

View File

@@ -53,9 +53,13 @@ export const getGitHubGatewayConnectionDetails = async (
targetHost: string,
gatewayV2Service: Pick<TGatewayV2ServiceFactory, "getPlatformConnectionDetailsByGatewayId">
): Promise<Awaited<ReturnType<TGatewayV2ServiceFactory["getPlatformConnectionDetailsByGatewayId"]>>> => {
const urlString = targetHost.includes("://") ? targetHost : `https://${targetHost}`;
const url = new URL(urlString);
const { hostname } = url;
return gatewayV2Service.getPlatformConnectionDetailsByGatewayId({
gatewayId,
targetHost,
targetHost: hostname,
targetPort: 443
});
};