You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
environmentd: make webhook max request size configurable (#37277)
### Motivation
The webhook source request body limit was a compile-time constant (5
MiB) applied to all HTTP routes, so operators could not adjust it
without a rebuild.
### Description
Adds the `webhook_max_request_size_bytes` dyncfg (default 5 MiB,
preserving prior behavior). It is read from the live shared persist
`ConfigSet`, so there is no coordinator round-trip on the webhook hot
path. The webhook route disables the global `DefaultBodyLimit` and the
handler enforces the cap per request on the decompressed body via
`to_bytes`: size-exceeded returns 413, other body-read errors return
500. Enforcement is scoped to the webhook route only; SQL and other HTTP
routes keep the static 5 MiB limit.
### Verification
New integration test `webhook_max_request_size` in
`src/environmentd/tests/server.rs`: the 5 MiB default rejects a 6 MiB
body, raising the dyncfg accepts it, and lowering it below the default
re-rejects.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
"Maximum size in bytes of MCP tool response content. Responses exceeding this limit are rejected with an error telling the agent to narrow its query.",
222
222
);
223
223
224
+
/// Maximum size (in bytes) of a webhook request body, measured after
225
+
/// decompression. Requests whose body exceeds this limit are rejected with
226
+
/// HTTP 413. Applies only to the webhook route; other HTTP routes use a
0 commit comments