We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a4fe18 commit 4d570d3Copy full SHA for 4d570d3
frontend/src/ts/utils/json-data.ts
@@ -12,7 +12,7 @@ async function fetchJson<T>(url: string): Promise<T> {
12
if (!url) throw new Error("No URL");
13
const res = await fetch(url);
14
if (res.ok) {
15
- if (res.headers.get("content-type") !== "application/json") {
+ if (!res.headers.get("content-type")?.startsWith("application/json")) {
16
throw new Error("Content is not JSON");
17
}
18
return (await res.json()) as T;
0 commit comments