mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 02:51:14 +00:00
fix(core): Setup webhook stopping endpoint after the CORS middleware (no-changelog) (#9454)
This commit is contained in:
committed by
GitHub
parent
04dd4760e1
commit
6f2d83bffd
@@ -207,13 +207,6 @@ export abstract class AbstractServer {
|
|||||||
// Register a handler
|
// Register a handler
|
||||||
this.app.all(`/${this.endpointFormTest}/:path(*)`, webhookRequestHandler(testWebhooks));
|
this.app.all(`/${this.endpointFormTest}/:path(*)`, webhookRequestHandler(testWebhooks));
|
||||||
this.app.all(`/${this.endpointWebhookTest}/:path(*)`, webhookRequestHandler(testWebhooks));
|
this.app.all(`/${this.endpointWebhookTest}/:path(*)`, webhookRequestHandler(testWebhooks));
|
||||||
|
|
||||||
// Removes a test webhook
|
|
||||||
// TODO UM: check if this needs validation with user management.
|
|
||||||
this.app.delete(
|
|
||||||
`/${this.restEndpoint}/test-webhook/:id`,
|
|
||||||
send(async (req) => await testWebhooks.cancelWebhook(req.params.id)),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Block bots from scanning the application
|
// Block bots from scanning the application
|
||||||
@@ -230,6 +223,16 @@ export abstract class AbstractServer {
|
|||||||
this.setupDevMiddlewares();
|
this.setupDevMiddlewares();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.testWebhooksEnabled) {
|
||||||
|
const testWebhooks = Container.get(TestWebhooks);
|
||||||
|
// Removes a test webhook
|
||||||
|
// TODO UM: check if this needs validation with user management.
|
||||||
|
this.app.delete(
|
||||||
|
`/${this.restEndpoint}/test-webhook/:id`,
|
||||||
|
send(async (req) => await testWebhooks.cancelWebhook(req.params.id)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Setup body parsing middleware after the webhook handlers are setup
|
// Setup body parsing middleware after the webhook handlers are setup
|
||||||
this.app.use(bodyParser);
|
this.app.use(bodyParser);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user