From c85a846fcee843ae830d1acd0833ddf95fbb3d7e Mon Sep 17 00:00:00 2001 From: Lia Lenckowski Date: Wed, 23 Aug 2023 17:53:59 +0200 Subject: make all urls relative now works with url-rewriting reverse proxies, when BASE_URL is set correctly --- frontend/admin.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'frontend/admin.ts') diff --git a/frontend/admin.ts b/frontend/admin.ts index 1b6ba90..40a7a94 100644 --- a/frontend/admin.ts +++ b/frontend/admin.ts @@ -10,7 +10,7 @@ interface PendingBang { async function sendVerdict(user: string, pw: string, b: PendingBang, accept: boolean, info_block: HTMLDivElement) { - let err = await fetch(accept? "/acceptBang" : "/rejectBang", { + let err = await fetch(accept? "acceptBang" : "rejectBang", { headers: { Accept: "application/json", "Content-Type": "application/json", @@ -26,12 +26,12 @@ async function sendVerdict(user: string, pw: string, b: PendingBang, else info_block.remove() // TODO in the accept case, we should try invalidating the browser cache - // for /bangs.json. My idea is to make a HEAD request to let the browser + // for ./bangs.json. My idea is to make a HEAD request to let the browser // see that the etag has changed; idk of that works } export async function tryLoadAdminPanel(user: string, pw: string) { - const r = await fetch("/pendingBangs", { + const r = await fetch("pendingBangs", { headers: { Accept: "application/json", Authorization: "Basic " + btoa(`${user}:${pw}`), -- cgit v1.2.3-70-g09d2