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
{{ message }}
Repository navigation
No guard against Lambda's ~6 MB synchronous payload limit #36
Default max_body_size is 4 MiB (req_resp.go:22); a binary body base64-inflates to ~5.6 MB, and headers + envelope can push the marshaled payload past 6 MB. Larger user-configured values make it certain. AWS then rejects the invoke and the client gets a misleading 502.
I deliberately set the default to 4MB, because as you point out:
a binary body base64-inflates to ~5.6 MB
...which is just below the 6MB limit with a little overhead.
That said, we shouldn't be sending a 6MB+ request to Lambda if we know its going to fail; we could fail fast. An HTTP 413 Content Too Large seems appropriate.
Activity
danmoz commentedon Sep 5, 2026
I deliberately set the default to 4MB, because as you point out:
...which is just below the 6MB limit with a little overhead.
That said, we shouldn't be sending a 6MB+ request to Lambda if we know its going to fail; we could fail fast. An
HTTP 413 Content Too Largeseems appropriate./oc Please create a PR.