diff --git a/src/utils/proxy/api-helpers.js b/src/utils/proxy/api-helpers.js index a02ea623..4ba5b68b 100644 --- a/src/utils/proxy/api-helpers.js +++ b/src/utils/proxy/api-helpers.js @@ -2,10 +2,13 @@ export function formatApiCall(url, args) { const find = /\{.*?\}/g; const replace = (match) => { const key = match.replace(/\{|\}/g, ""); + if (key === "url") { + args[key] = args[key].replace(/\/+$/, ""); // remove trailing slashes + } return args[key] || ""; }; - return url.replace(/\/+$/, "").replace(find, replace).replace(find, replace); + return url.replace(find, replace).replace(find, replace); } export function getURLSearchParams(widget, endpoint) {