Skip to content

[codex] Limit multipart header block size#6

Merged
chrislearn merged 2 commits intomainfrom
codex/header-size-limit
Apr 1, 2026
Merged

[codex] Limit multipart header block size#6
chrislearn merged 2 commits intomainfrom
codex/header-size-limit

Conversation

@chrislearn
Copy link
Copy Markdown
Member

Summary

  • add an explicit size limit for each field's full header block
  • reject oversized multipart headers with a dedicated HeadersSizeExceeded error
  • add integration coverage for both accepted and rejected header sizes

Why

Multipart header parsing previously depended on the whole-stream limit for memory safety. If callers left whole_stream unbounded, a request with an oversized header block could grow memory until EOF or until the separator was found.

Impact

Callers now get a finite default header-block limit and can override it through SizeLimit::headers(...) when needed.

Validation

  • cargo test --all --all-features
  • cargo clippy --tests --examples --bins -- -D warnings

…ader_and_constraints`

Signed-off-by: Chrislearn Young <chris@acroidea.com>
@chrislearn chrislearn marked this pull request as ready for review April 1, 2026 15:19
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chrislearn chrislearn merged commit 788c838 into main Apr 1, 2026
3 checks passed
@chrislearn chrislearn deleted the codex/header-size-limit branch April 1, 2026 15:20
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