fix(whatsapp): set client_max_size on the webhook Application

Follow-up to the salvaged #54944: before this, aiohttp's implicit 1 MiB
default client_max_size tripped BEFORE the intended 3 MB Meta cap could
apply on read() paths — the explicit value makes the documented limit
real while the bounded reader keeps chunked bodies from buffering past
3 MB (#58536/#58902/#59180 pattern).
This commit is contained in:
teknium1 2026-07-05 15:09:22 -07:00 committed by Teknium
parent eec92a92c0
commit e82d71db40

View file

@ -415,7 +415,10 @@ class WhatsAppCloudAdapter(WhatsAppBehaviorMixin, BasePlatformAdapter):
)
# Inbound webhook server.
app = web.Application()
# client_max_size backstops the bounded reader in _handle_webhook —
# aiohttp enforces the cap on request.read()/post() paths too
# (#58536/#58902/#59180 pattern).
app = web.Application(client_max_size=WEBHOOK_MAX_BODY_BYTES)
app.router.add_get(self._health_path, self._handle_health)
app.router.add_get(self._webhook_path, self._handle_verify)
app.router.add_post(self._webhook_path, self._handle_webhook)