From dc5ae7a7b11b5b846501bc83ccb412d84af3c39a Mon Sep 17 00:00:00 2001 From: BennyKok Date: Sun, 24 Dec 2023 18:51:59 +0800 Subject: [PATCH] fix(plugin): ensure endpoints with / works in plugin --- web-plugin/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web-plugin/index.js b/web-plugin/index.js index cdee7be..5aedf7e 100644 --- a/web-plugin/index.js +++ b/web-plugin/index.js @@ -147,6 +147,11 @@ function addButton() { console.log(prompt); + // TODO trim the ending / from endpoint is there is + if (endpoint.endsWith("/")) { + endpoint = endpoint.slice(0, -1); + } + const apiRoute = endpoint + "/api/upload" // const userId = apiKey try {