Skip to content

Commit 4c3aef6

Browse files
cursoragentmsukkari
andcommitted
Strip all trailing slashes from host URLs
Changed regex from /\\/$/ to /\\/+$/ to handle cases where there might be multiple trailing slashes in the configured URL. Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
1 parent 6b61cc5 commit 4c3aef6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/backend/src/repoCompileUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export const compileGitlabConfig = async (
160160
const gitlabRepos = gitlabReposResult.repos;
161161
const warnings = gitlabReposResult.warnings;
162162

163-
const hostUrl = (config.url ?? 'https://gitlab.com').replace(/\/$/, '');
163+
const hostUrl = (config.url ?? 'https://gitlab.com').replace(/\/+$/, '');
164164
const repoNameRoot = new URL(hostUrl)
165165
.toString()
166166
.replace(/^https?:\/\//, '');
@@ -724,7 +724,7 @@ export const compileAzureDevOpsConfig = async (
724724
const azureDevOpsRepos = azureDevOpsReposResult.repos;
725725
const warnings = azureDevOpsReposResult.warnings;
726726

727-
const hostUrl = (config.url ?? 'https://dev.azure.com').replace(/\/$/, '');
727+
const hostUrl = (config.url ?? 'https://dev.azure.com').replace(/\/+$/, '');
728728
const repoNameRoot = new URL(hostUrl)
729729
.toString()
730730
.replace(/^https?:\/\//, '');

0 commit comments

Comments
 (0)