mirror of
https://github.com/portainer/portainer.git
synced 2025-08-04 13:25:26 +02:00
fix(gitops): clean trailing slash [EE-6346] (#10777)
Co-authored-by: testa113 <testa113>
This commit is contained in:
parent
a2d6d6002c
commit
4e8b371fb7
4 changed files with 18 additions and 16 deletions
|
@ -32,3 +32,10 @@ export function confirmEnableTLSVerify() {
|
|||
'Enabling the verification of TLS certificates without ensuring the correct configuration of your Certificate Authority (CA) for self-signed certificates can result in deployment failures.',
|
||||
});
|
||||
}
|
||||
|
||||
export function cleanGitRepoUrl(url: string) {
|
||||
return url
|
||||
.trim() // remove leading and trailing whitespace
|
||||
.replace(/\/$/, '') // if there's a trailing slash, remove it
|
||||
.replace(/\.git$/, ''); // if there's a trailing .git extension, remove it
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue