From 7441f0861a69103fc5c09f89cbcb05f61a7a7fdf Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 25 Apr 2024 08:15:40 +0900 Subject: [PATCH] fix (backend): fix order of logger initialization --- packages/backend/src/server/activitypub.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/activitypub.ts b/packages/backend/src/server/activitypub.ts index 82deabfecc..2ada433eb5 100644 --- a/packages/backend/src/server/activitypub.ts +++ b/packages/backend/src/server/activitypub.ts @@ -42,9 +42,9 @@ const router = new Router(); //#region Routing -const inboxLogger = serverLogger.createSubLogger("inbox"); - function inbox(ctx: Router.RouterContext) { + const inboxLogger = serverLogger.createSubLogger("inbox"); + if (ctx.req.headers.host !== config.host) { inboxLogger.warn(`regecting invalid host (${ctx.req.headers.host})`); ctx.status = 400;