web/session: don't expect a trailing slash in DEFAULT_URL

This commit is contained in:
wukko 2024-08-16 23:52:40 +06:00
parent 3336210e93
commit a49a87544c
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2
2 changed files with 3 additions and 3 deletions

View file

@ -5,7 +5,7 @@ import settings from "$lib/state/settings";
export const currentApiURL = () => {
if (env.DEFAULT_API && get(settings).processing.allowDefaultOverride) {
return env.DEFAULT_API;
return new URL(env.DEFAULT_API).origin;
}
return apiURL;
return new URL(apiURL).origin;
}

View file

@ -7,7 +7,7 @@ import { cachedSession } from "$lib/state/session";
import type { CobaltSessionResponse, CobaltErrorResponse } from "$lib/types/api";
export const requestSession = async() => {
const apiEndpoint = `${currentApiURL()}session`;
const apiEndpoint = `${currentApiURL()}/session`;
let requestHeaders = {};