show not allowed list

This commit is contained in:
Andras Bacsai 2022-09-06 10:43:59 +02:00
parent 26e4d52a61
commit 8f14fd89ef

View File

@ -110,10 +110,8 @@ fastify.addHook('onRequest', async (request, reply) => {
allowedList.push(`${remote.remoteIpAddress}:3000`); allowedList.push(`${remote.remoteIpAddress}:3000`);
}) })
} }
console.log({ allowedList }) if (!allowedList.includes(request.headers.host)) {
console.log({ host: request.headers.host, origin: request.headers.origin }) console.log('not allowed', request.headers.host)
if (!request.headers.origin && !request.headers.host.startsWith('host.docker.internal')) {
} }
}) })
fastify.listen({ port, host }, async (err: any, address: any) => { fastify.listen({ port, host }, async (err: any, address: any) => {