diff --git a/functions/_middleware.ts b/functions/_middleware.ts index 1cd5b26..75042fa 100644 --- a/functions/_middleware.ts +++ b/functions/_middleware.ts @@ -195,7 +195,11 @@ async function setBody(context: RequestContext) { context.request.method === "POST" && !context.request.url.endsWith("/api/infractions/new") ) { - if (context.request.headers.get("content-type") !== "application/json") + if ( + !context.request.headers + .get("content-type") + ?.startsWith("application/json") + ) return new Response('{"error":"Invalid content-type"}', { headers: { "content-type": "application/json",