From 8d1e75a8acc89adb4c882d3136a24329d2fd497a Mon Sep 17 00:00:00 2001 From: Po Chen Date: Tue, 7 Jun 2022 11:01:45 +1000 Subject: [PATCH] fix: prefix logic --- 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);