From a8da9c31a95dabbbdc4eb67e5157dd5631ff3031 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: Wed, 28 Sep 2022 17:09:26 +0200 Subject: [PATCH] fix(cli): Disable `X-Powered-By: Express` Header (#4224) --- packages/cli/commands/worker.ts | 2 ++ packages/cli/src/Server.ts | 1 + packages/cli/src/WebhookServer.ts | 1 + 3 files changed, 4 insertions(+) diff --git a/packages/cli/commands/worker.ts b/packages/cli/commands/worker.ts index 3c4d30d1fe..4ecda5c702 100644 --- a/packages/cli/commands/worker.ts +++ b/packages/cli/commands/worker.ts @@ -370,6 +370,8 @@ export class Worker extends Command { const port = config.getEnv('queue.health.port'); const app = express(); + app.disable('x-powered-by'); + const server = http.createServer(app); app.get( diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index d3c8042f35..34e6440cd9 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -217,6 +217,7 @@ class App { constructor() { this.app = express(); + this.app.disable('x-powered-by'); this.endpointWebhook = config.getEnv('endpoints.webhook'); this.endpointWebhookWaiting = config.getEnv('endpoints.webhookWaiting'); diff --git a/packages/cli/src/WebhookServer.ts b/packages/cli/src/WebhookServer.ts index 465db8c94a..30e35b1659 100644 --- a/packages/cli/src/WebhookServer.ts +++ b/packages/cli/src/WebhookServer.ts @@ -193,6 +193,7 @@ class App { constructor() { this.app = express(); + this.app.disable('x-powered-by'); this.endpointWebhook = config.getEnv('endpoints.webhook'); this.endpointWebhookWaiting = config.getEnv('endpoints.webhookWaiting');