From ae3ae00cb7a622a2c0a3fd053c78b3f1b73117fd Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sun, 15 Sep 2024 07:03:24 +0300 Subject: [PATCH] Fixed last slash bug when adding a custom instance https://github.com/libredirect/browser_extension/issues/996 --- src/assets/javascripts/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index e5b8ba46..d81a96bc 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -31,7 +31,8 @@ function protocolHost(url) { if (url.pathname == "/TekstoLibre/" && url.host.endsWith("github.io")) return `${url.protocol}//${url.host}${url.pathname.slice(0, -1)}` - return `${url.protocol}//${url.host}${url.pathname}` + const pathname = url.pathname != "/" ? url.pathname : "" + return `${url.protocol}//${url.host}${pathname}` } /**