fix(sms): set client_max_size on the Twilio webhook Application

Follow-up to the salvaged #54620: the post-read length check bounds
processing but a chunked body is still buffered by aiohttp first.
client_max_size enforces the same 64 KiB cap mid-read on every path
(#58536/#58902/#59180 pattern).
This commit is contained in:
teknium1 2026-07-05 15:00:32 -07:00 committed by Teknium
parent 940b69b1a8
commit 3dd5ce236a

View file

@ -119,7 +119,10 @@ class SmsAdapter(BasePlatformAdapter):
self._webhook_port,
)
app = web.Application()
# client_max_size bounds every read path — including chunked bodies
# with no Content-Length — before the handler's own 413 checks run
# (#58536/#58902/#59180 pattern).
app = web.Application(client_max_size=_TWILIO_WEBHOOK_MAX_BODY_BYTES)
app.router.add_post("/webhooks/twilio", self._handle_webhook)
app.router.add_get("/health", lambda _: web.Response(text="ok"))