From 22edc03cab7b8935d071377270f75c3dabbf43f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Tue, 12 Sep 2023 19:57:25 +0200 Subject: [PATCH] fix(core): Ignore missing user-agent on bot check (no-changelog) (#7153) --- packages/cli/src/AbstractServer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/src/AbstractServer.ts b/packages/cli/src/AbstractServer.ts index 2e25342bc1..8c3d5b5bbd 100644 --- a/packages/cli/src/AbstractServer.ts +++ b/packages/cli/src/AbstractServer.ts @@ -201,7 +201,7 @@ export abstract class AbstractServer { const checkIfBot = isbot.spawn(['bot']); this.app.use((req, res, next) => { const userAgent = req.headers['user-agent']; - if (!userAgent || checkIfBot(userAgent)) { + if (userAgent && checkIfBot(userAgent)) { Logger.info(`Blocked ${req.method} ${req.url} for "${userAgent}"`); res.status(204).end(); } else next();