shareUrl: use URL interface instead of string manipulations

This commit is contained in:
contributor 2025-11-18 10:32:33 +02:00
parent 5b387a0b11
commit e937f1b601

View File

@ -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("/")) {