From 8d0a619e81a78c5f872bc1af0581b9bc94335dbe Mon Sep 17 00:00:00 2001 From: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com> Date: Tue, 9 Jan 2024 06:06:02 +0100 Subject: [PATCH] fix(web): handle trailing slash in external domain (#6253) --- web/src/api/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/api/utils.ts b/web/src/api/utils.ts index f2f8f50cc5..179b328f56 100644 --- a/web/src/api/utils.ts +++ b/web/src/api/utils.ts @@ -20,7 +20,8 @@ export const copyToClipboard = async (secret: string) => { }; export const makeSharedLinkUrl = (externalDomain: string, key: string) => { - return `${externalDomain || window.location.origin}/share/${key}`; + const url = externalDomain || window.location.origin; + return `${url + url.endsWith('/') ? '' : '/'}share/${key}`; }; export const oauth = {