mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 20:00:02 +00:00
feat(core): Upgrade to express 5 to address CVE-2024-52798 (#14332)
This commit is contained in:
committed by
GitHub
parent
02d11b5e7a
commit
4110f3188e
@@ -114,14 +114,17 @@ export abstract class AbstractServer {
|
||||
|
||||
private async setupHealthCheck() {
|
||||
// main health check should not care about DB connections
|
||||
this.app.get('/healthz', async (_req, res) => {
|
||||
this.app.get('/healthz', (_req, res) => {
|
||||
res.send({ status: 'ok' });
|
||||
});
|
||||
|
||||
this.app.get('/healthz/readiness', async (_req, res) => {
|
||||
return Db.connectionState.connected && Db.connectionState.migrated
|
||||
? res.status(200).send({ status: 'ok' })
|
||||
: res.status(503).send({ status: 'error' });
|
||||
this.app.get('/healthz/readiness', (_req, res) => {
|
||||
const { connected, migrated } = Db.connectionState;
|
||||
if (connected && migrated) {
|
||||
res.status(200).send({ status: 'ok' });
|
||||
} else {
|
||||
res.status(503).send({ status: 'error' });
|
||||
}
|
||||
});
|
||||
|
||||
const { connectionState } = Db;
|
||||
@@ -183,20 +186,20 @@ export abstract class AbstractServer {
|
||||
if (this.webhooksEnabled) {
|
||||
const liveWebhooksRequestHandler = createWebhookHandlerFor(Container.get(LiveWebhooks));
|
||||
// Register a handler for live forms
|
||||
this.app.all(`/${this.endpointForm}/:path(*)`, liveWebhooksRequestHandler);
|
||||
this.app.all(`/${this.endpointForm}/*path`, liveWebhooksRequestHandler);
|
||||
|
||||
// Register a handler for live webhooks
|
||||
this.app.all(`/${this.endpointWebhook}/:path(*)`, liveWebhooksRequestHandler);
|
||||
this.app.all(`/${this.endpointWebhook}/*path`, liveWebhooksRequestHandler);
|
||||
|
||||
// Register a handler for waiting forms
|
||||
this.app.all(
|
||||
`/${this.endpointFormWaiting}/:path/:suffix?`,
|
||||
`/${this.endpointFormWaiting}/:path/{:suffix}`,
|
||||
createWebhookHandlerFor(Container.get(WaitingForms)),
|
||||
);
|
||||
|
||||
// Register a handler for waiting webhooks
|
||||
this.app.all(
|
||||
`/${this.endpointWebhookWaiting}/:path/:suffix?`,
|
||||
`/${this.endpointWebhookWaiting}/:path/{:suffix}`,
|
||||
createWebhookHandlerFor(Container.get(WaitingWebhooks)),
|
||||
);
|
||||
}
|
||||
@@ -205,8 +208,8 @@ export abstract class AbstractServer {
|
||||
const testWebhooksRequestHandler = createWebhookHandlerFor(Container.get(TestWebhooks));
|
||||
|
||||
// Register a handler
|
||||
this.app.all(`/${this.endpointFormTest}/:path(*)`, testWebhooksRequestHandler);
|
||||
this.app.all(`/${this.endpointWebhookTest}/:path(*)`, testWebhooksRequestHandler);
|
||||
this.app.all(`/${this.endpointFormTest}/*path`, testWebhooksRequestHandler);
|
||||
this.app.all(`/${this.endpointWebhookTest}/*path`, testWebhooksRequestHandler);
|
||||
}
|
||||
|
||||
// Block bots from scanning the application
|
||||
|
||||
Reference in New Issue
Block a user