From e70cca4736cb127613218ca51574d7a7370a0583 Mon Sep 17 00:00:00 2001 From: zadam Date: Wed, 29 Mar 2023 23:07:47 +0200 Subject: [PATCH] fix trailing slash in shared note in IE, closes #3782 --- src/public/app/widgets/shared_info.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/public/app/widgets/shared_info.js b/src/public/app/widgets/shared_info.js index 8029ba24b..ebdfbb108 100644 --- a/src/public/app/widgets/shared_info.js +++ b/src/public/app/widgets/shared_info.js @@ -39,7 +39,14 @@ export default class SharedInfoWidget extends NoteContextAwareWidget { this.$sharedText.text("This note is shared publicly on"); } else { - link = `${location.protocol}//${location.host}${location.pathname}share/${shareId}`; + let host = location.host; + if (host.endsWith('/')) { + // seems like IE has trailing slash + // https://github.com/zadam/trilium/issues/3782 + host = host.substr(0, host.length - 1); + } + + link = `${location.protocol}//${host}${location.pathname}share/${shareId}`; this.$sharedText.text("This note is shared locally on"); }