From 3409316853d299daa121d698fd352e045711acf0 Mon Sep 17 00:00:00 2001 From: Alex Tugarev Date: Tue, 2 Aug 2022 09:09:30 +0000 Subject: [PATCH] [dashboard] Fix rendering of the redirect URI on Git Integrations page --- components/dashboard/src/settings/Integrations.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/dashboard/src/settings/Integrations.tsx b/components/dashboard/src/settings/Integrations.tsx index 293455dc2bec6e..63c1a54bb9845f 100644 --- a/components/dashboard/src/settings/Integrations.tsx +++ b/components/dashboard/src/settings/Integrations.tsx @@ -643,6 +643,12 @@ export function GitIntegrationModal( newHostValue = host.replace("https://", ""); } + // Negative Lookahead (?!\/) + // `\/` matches the character `/` + // "https://foobar:80".replace(/:(?!\/)/, "_") + // => 'https://foobar_80' + newHostValue = host.replace(/:(?!\/)/, "_"); + setHost(newHostValue); setRedirectURL(callbackUrl(newHostValue)); setErrorMessage(undefined);