diff options
author | Alan Pearce | 2024-05-17 17:37:35 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-17 17:37:35 +0200 |
commit | 2edf3f098dd1bb79fd97a8f30fe28938cbde9f3c (patch) | |
tree | 52af1e04822033f259578c12266f3ff1fbde525d /frontend | |
parent | f9b034027565bbc59b36d1a318716088c3a77977 (diff) | |
download | searchix-2edf3f098dd1bb79fd97a8f30fe28938cbde9f3c.tar.lz searchix-2edf3f098dd1bb79fd97a8f30fe28938cbde9f3c.tar.zst searchix-2edf3f098dd1bb79fd97a8f30fe28938cbde9f3c.zip |
fix: render errors as HTML given correct content-type
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/static/search.js | 3 |
1 files changed, 2 insertions, 1 deletions
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); |