fix(feishu): set client_max_size on the webhook Application

Follow-up to the salvaged #54938: the bounded reader gives a proper 413 +
anomaly telemetry for oversized chunked bodies; client_max_size makes
aiohttp enforce the same 1 MiB cap on every other read path
(#58536/#58902/#59180 pattern). Test fixture's fake Application now
accepts kwargs.
This commit is contained in:
teknium1 2026-07-05 15:12:55 -07:00 committed by Teknium
parent a26680eb2d
commit 2bcb893d87
2 changed files with 5 additions and 2 deletions

View file

@ -4747,7 +4747,10 @@ class FeishuAdapter(BasePlatformAdapter):
if self._event_handler is None:
raise RuntimeError("failed to build Feishu event handler")
await self._hydrate_bot_identity()
app = web.Application()
# client_max_size backstops the bounded reader in
# _handle_webhook_request; aiohttp then enforces the same cap on
# every read path (#58536/#58902/#59180 pattern).
app = web.Application(client_max_size=_FEISHU_WEBHOOK_MAX_BODY_BYTES)
app.router.add_post(self._webhook_path, self._handle_webhook_request)
self._webhook_runner = web.AppRunner(app)
await self._webhook_runner.setup()