Add content-type enforcement bypass for new infraction endpoint
This commit is contained in:
parent
86f67294fb
commit
106cedec77
@ -49,7 +49,10 @@ async function setAuth(context: RequestContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function setBody(context: RequestContext) {
|
async function setBody(context: RequestContext) {
|
||||||
if (context.request.method === "POST") {
|
if (
|
||||||
|
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") !== "application/json")
|
||||||
return new Response('{"error":"Invalid content-type"}', {
|
return new Response('{"error":"Invalid content-type"}', {
|
||||||
headers: {
|
headers: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user