Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Once again work around weird routing behavior
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent b234471 commit afbea74
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions 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);

Expand Down

0 comments on commit afbea74

Please sign in to comment.