Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Fix getGitHubGatewayConnectionDetails to use the correct hostname without any url paths

Carlos Monastyrskiee24e55dd56e
diff --git a/backend/src/services/app-connection/github/github-connection-fns.ts b/backend/src/services/app-connection/github/github-connection-fns.ts
index da17757ee0..41681502e2 100644
--- a/backend/src/services/app-connection/github/github-connection-fns.ts
+++ b/backend/src/services/app-connection/github/github-connection-fns.ts
@@ -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
});
};