From 2edf3f098dd1bb79fd97a8f30fe28938cbde9f3c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 17 May 2024 17:37:35 +0200 Subject: fix: render errors as HTML given correct content-type --- frontend/static/search.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'frontend') diff --git a/frontend/static/search.js b/frontend/static/search.js index 030a318..d9993e4 100644 --- a/frontend/static/search.js +++ b/frontend/static/search.js @@ -80,7 +80,8 @@ async function getResults(url) { }, }); - if (res.ok) { + // render errors sent as HTML as well as OK responses + if (res.headers.get("content-type").startsWith("text/html")) { state.fragment = await res.text(); state.opened = []; history.replaceState(state, null, url); -- cgit 1.4.1