Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Merging this PR will not alter performance
Comparing Footnotes
|
|
I checked
The full PR suite had 230 passed; main + PR + the additional tests had 335 passed, with 100% coverage on each Python version. The combined 172 limit/review tests also passed with On Python 3.11, Atheris 2.3.0 could not build because Apple Clang lacks libFuzzer. I used |
Summary
Add opt-in
MAX_FIELDSandMAX_FIELD_SIZEconfiguration for URL-encoded forms inFormParser. Count fields before assembling them and check combined raw name/value bytes before buffering incoming data. Both limits default to infinity, raiseFormParserErrorwhen exceeded, and leave multipart forms and file uploads unchanged.This lets Starlette reuse upstream field assembly instead of maintaining its own message queue. The caller still calls
finalize()after stream exhaustion.Closes #332.
Validation
The full suite ignores pre-existing
ResourceWarnings from unclosed files in three existing tests; these also reproduce on unchangedmain.Performance
Local interleaved microbenchmarks on CPython 3.13 measured approximately 10-14% overhead for small URL-encoded forms and 2% for a 1 MiB field, compared with the existing high-level
FormParser. Whether replacing Starlette's queue improves end-to-end performance still needs an integration benchmark.AI Disclaimer
This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.