From afbea74028817663ad8d00e83efe139888125b0e Mon Sep 17 00:00:00 2001 From: regalijan Date: Thu, 19 Oct 2023 16:51:06 -0400 Subject: [PATCH] Once again work around weird routing behavior --- functions/api/game-appeals/[id]/_middleware.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/functions/api/game-appeals/[id]/_middleware.ts b/functions/api/game-appeals/[id]/_middleware.ts index c342102..03e6d34 100644 --- a/functions/api/game-appeals/[id]/_middleware.ts +++ b/functions/api/game-appeals/[id]/_middleware.ts @@ -1,6 +1,11 @@ import { jsonError } from "../../../common.js"; export async function onRequest(context: RequestContext) { + const { pathname } = new URL(context.request.url); + + if (pathname.endsWith("/metadata") || pathname.endsWith("/submit")) + return await context.next(); + if (!(context.data.current_user.permissions & (1 << 5))) return jsonError("Forbidden", 403);