From dcf0bc65bfcfc7df3804d7392598a92019468cf7 Mon Sep 17 00:00:00 2001 From: Po Chen Date: Fri, 10 Jun 2022 20:05:05 +1000 Subject: [PATCH] fix: preview url building fix (#1976) --- frontend/src/api/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/api/utils.js b/frontend/src/api/utils.js index b995bcb8..87d6a243 100644 --- a/frontend/src/api/utils.js +++ b/frontend/src/api/utils.js @@ -63,7 +63,7 @@ export function removePrefix(url) { export function createURL(endpoint, params = {}, auth = true) { let prefix = baseURL; - if (prefix[prefix.length] !== "/") { + if (!prefix.endsWith("/")) { prefix = prefix + "/"; } const url = new URL(prefix + encodePath(endpoint), origin);