From 0873f9a03cd0f707c054c30a70cc025697824df2 Mon Sep 17 00:00:00 2001 From: Mel <97147377+MelissaAutumn@users.noreply.github.com> Date: Fri, 19 Jul 2024 10:18:50 -0700 Subject: [PATCH] Only add slash if the apiUrl doesn't already have one. Fixes picky stage server. (#572) --- frontend/src/main.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 81afb4643..3af02aa22 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -89,7 +89,8 @@ if (useSentry) { const effectiveDeviceRes = `${window?.screen?.availWidth ?? -1}x${window?.screen?.availHeight ?? -1}`; // Native fetch! - fetch(`${apiUrl}/page-load`, { + const url = apiUrl.endsWith('/') ? `${apiUrl}page-load` : `${apiUrl}/page-load`; + fetch(url, { method: 'POST', headers: { Accept: 'application/json',