Skip to content

Commit

Permalink
Only add slash if the apiUrl doesn't already have one. Fixes picky st…
Browse files Browse the repository at this point in the history
…age server. (#572)
  • Loading branch information
MelissaAutumn authored Jul 19, 2024
1 parent dfc1c38 commit 0873f9a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 0873f9a

Please sign in to comment.