From e4bcd23f9d48047f9c5dc29ab3d068e2c2b481b7 Mon Sep 17 00:00:00 2001 From: naskya Date: Sun, 25 Feb 2024 20:30:03 +0900 Subject: [PATCH] fix (backend): check url properly Co-authored-by: syuilo --- packages/backend/src/server/web/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/web/index.ts b/packages/backend/src/server/web/index.ts index b36b8485b..ec64bc9b2 100644 --- a/packages/backend/src/server/web/index.ts +++ b/packages/backend/src/server/web/index.ts @@ -54,7 +54,9 @@ const bullBoardPath = "/queue"; // Authenticate app.use(async (ctx, next) => { - if (ctx.path === bullBoardPath || ctx.path.startsWith(`${bullBoardPath}/`)) { + const url = decodeURI(ctx.path); + + if (url === bullBoardPath || url.startsWith(`${bullBoardPath}/`)) { const token = ctx.cookies.get("token"); if (token == null) { ctx.status = 401;