1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 13:29:41 +02:00

fix(app): fix app ingress edge cases [EE-5663] (#9150)

Co-authored-by: testa113 <testa113>
This commit is contained in:
Ali 2023-07-10 16:20:22 +12:00 committed by GitHub
parent 8b11e1678e
commit c752b98120
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 44 additions and 10 deletions

View file

@ -154,6 +154,8 @@ export function generateNewIngressesFromFormPaths(
return newIngresses;
}
/** prependWithSlash puts a '/' in front of a string if there isn't one there already. If the string is empty, it stays empty */
export function prependWithSlash(path?: string) {
return path?.startsWith('/') ? path : `/${path}`;
if (!path) return '';
return path.startsWith('/') ? path : `/${path}`;
}