From e9ef70e272f0947f675da7d9c50bb09a5fabcc39 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 38d193683..90126440c 100644 --- a/packages/backend/src/server/web/index.ts +++ b/packages/backend/src/server/web/index.ts @@ -52,7 +52,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;