Skip to content

cap inbound request body size - #7

Merged
OneNobleSoul merged 1 commit into
mainfrom
max-body-size
Jul 18, 2026
Merged

cap inbound request body size#7
OneNobleSoul merged 1 commit into
mainfrom
max-body-size

Conversation

@OneNobleSoul

Copy link
Copy Markdown
Owner

do_POST reads Content-Length bytes straight into memory with no upper bound. For a relay meant to sit on the open internet, a single request with a huge Content-Length can exhaust memory before handle_webhook ever sees it.

Adds max_body_bytes to the config (default 1 MiB) and rejects oversized requests with 413 before the body is read off the socket. Documented in the README config example and limitations section, tests added for config parsing and the actual HTTP behavior.

do_POST read Content-Length bytes into memory with no upper bound, so
a single request with a huge Content-Length could exhaust memory on
a relay meant to sit on the open internet. add max_body_bytes to the
config (default 1 MiB) and reject oversized requests with 413 before
the body is read.
@OneNobleSoul
OneNobleSoul merged commit a3cfe1f into main Jul 18, 2026
3 checks passed
@OneNobleSoul
OneNobleSoul deleted the max-body-size branch July 18, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant