fix(gateway): enforce request body size limits
This commit is contained in:
@@ -99,7 +99,12 @@ export function registerChannels(deps: ChannelsDeps): ChannelsResult {
|
||||
// Register webhook handler adapter (if any webhooks configured)
|
||||
let webhookHandler: WebhookHandler | undefined;
|
||||
if (config.automation.webhooks.length > 0) {
|
||||
webhookHandler = new WebhookHandler(config.automation.webhooks, channelRegistry, config.automation.delivery_mode);
|
||||
webhookHandler = new WebhookHandler(
|
||||
config.automation.webhooks,
|
||||
channelRegistry,
|
||||
config.automation.delivery_mode,
|
||||
config.server.max_request_body_bytes,
|
||||
);
|
||||
channelRegistry.register(webhookHandler);
|
||||
gateway.setWebhookHandler(webhookHandler);
|
||||
console.log(`Registered ${config.automation.webhooks.length} webhook(s)`);
|
||||
|
||||
@@ -311,6 +311,7 @@ export function createGateway(deps: GatewayDeps): GatewayServer {
|
||||
},
|
||||
authHttp: config.server.auth_http,
|
||||
lock: config.server.lock,
|
||||
maxRequestBodyBytes: config.server.max_request_body_bytes,
|
||||
commandRegistry: deps.commandRegistry,
|
||||
intentRegistry: deps.intentRegistry,
|
||||
routingPolicy: deps.routingPolicy,
|
||||
|
||||
Reference in New Issue
Block a user