From 5b387a0b11c284dc038d7e51f55b866516d5ce2f Mon Sep 17 00:00:00 2001 From: contributor Date: Tue, 18 Nov 2025 01:30:58 +0200 Subject: [PATCH 1/2] fix share url can be broken because of extra slash --- apps/client/src/widgets/shared_info.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/client/src/widgets/shared_info.tsx b/apps/client/src/widgets/shared_info.tsx index d3665478a..cb98027c2 100644 --- a/apps/client/src/widgets/shared_info.tsx +++ b/apps/client/src/widgets/shared_info.tsx @@ -24,7 +24,8 @@ export default function SharedInfo() { const shareId = getShareId(note); if (syncServerHost) { - link = `${syncServerHost}/share/${shareId}`; + const cleanedServerHost = syncServerHost.replace(/\/$/, ""); + link = `${cleanedServerHost}/share/${shareId}`; } else { let host = location.host; if (host.endsWith("/")) { From e937f1b6012cd58860efe35069e72bc06549581e Mon Sep 17 00:00:00 2001 From: contributor Date: Tue, 18 Nov 2025 10:32:33 +0200 Subject: [PATCH 2/2] shareUrl: use URL interface instead of string manipulations --- apps/client/src/widgets/shared_info.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/client/src/widgets/shared_info.tsx b/apps/client/src/widgets/shared_info.tsx index cb98027c2..bd0b72bc2 100644 --- a/apps/client/src/widgets/shared_info.tsx +++ b/apps/client/src/widgets/shared_info.tsx @@ -24,8 +24,7 @@ export default function SharedInfo() { const shareId = getShareId(note); if (syncServerHost) { - const cleanedServerHost = syncServerHost.replace(/\/$/, ""); - link = `${cleanedServerHost}/share/${shareId}`; + link = new URL(`/share/${shareId}`, syncServerHost).href; } else { let host = location.host; if (host.endsWith("/")) {