From 8f14fd89efe8977237e3d95e3b21950ea017e711 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 6 Sep 2022 10:43:59 +0200 Subject: [PATCH] show not allowed list --- apps/api/src/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts index bd2fe73b3..3b73e4266 100644 --- a/apps/api/src/index.ts +++ b/apps/api/src/index.ts @@ -110,10 +110,8 @@ fastify.addHook('onRequest', async (request, reply) => { allowedList.push(`${remote.remoteIpAddress}:3000`); }) } - console.log({ allowedList }) - console.log({ host: request.headers.host, origin: request.headers.origin }) - if (!request.headers.origin && !request.headers.host.startsWith('host.docker.internal')) { - + if (!allowedList.includes(request.headers.host)) { + console.log('not allowed', request.headers.host) } }) fastify.listen({ port, host }, async (err: any, address: any) => {