Add streaming field limits to `FormParser`
维护者通常 1 天内回复
评估
调研方向
Start by reading FormParser and QuerystringParser, then inspect linked pull request #333 for the work already underway. Verify behavior across chunk boundaries and finalize(), with limits disabled by default and parser exceptions on exceeded field-count or field-size limits.
由索引模型根据 Issue 内容生成。
描述
FormParser already assembles URL-encoded fields and exposes an on_field callback, but it has no field-count or per-field size limits. MAX_BODY_SIZE cannot express these limits, and checking field size in on_field is too late: the field has already been buffered.
Add optional limits for the number of fields and the combined raw name/value size of each URL-encoded field. Enforce size limits before buffering the incoming bytes, raise a parser exception when a limit is exceeded, and leave limits disabled by default for compatibility. Enforcement must work across chunk boundaries and include the final field emitted by finalize().
Starlette currently implements these limits and field assembly around QuerystringParser, including a message queue. Upstream limits would let it reuse FormParser and remove that duplicated assembly and queue-draining logic. Context: starlette#3599. This is a feature request, not a finalization bug in python-multipart; the caller would still call finalize() after stream exhaustion.
- 主要语言
- Python
- 星标
- 537
- 派生
- 104
- 平均合并
- 3 小时
- 30 天内合并 PR
- 4
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Kludex/python-multipart 的其他 Issue
-
`Base64Decoder` raises `DecodeError` on line-wrapped (MIME-style) base64可能已有人在做 @prudhvi1709 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 25/100
Kludex/python-multipart#340 ·
维护者通常 1 天内回复
-
Clarify or handle non-Latin-1 str input in parse_options_header可能已有人在做 @gyanu2507 于 61 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 42/100
Kludex/python-multipart#319 ·
维护者通常 1 天内回复
-
How to set FormParser MAX_BODY_SIZE, MAX_MEMORY_FILE_SIZE?可能已有人在做 @dokson 于 138 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
Kludex/python-multipart#201 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
Skip header area?可能已有人在做 @Kludex 于 195 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 48/100
Kludex/python-multipart#59 · 3 条评论 ·
维护者通常 1 天内回复
-
Failing to parse non-standard line breaks可能已有人在做 @dokson 于 138 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 32/100
Kludex/python-multipart#31 · 4 条评论 · 4 个 reaction ·
维护者通常 1 天内回复
查看 Kludex/python-multipart 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 77/100
khuisman/mcp-gee-sweet#1166 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
lugassawan/swe-workbench#823 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
gramaziokohler/compas_timber#870 ·
-
security-scan-failure
难度 2/5 1-3 小时 新手友好度 78/100
semantica-agi/semantica#2089 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
autowarefoundation/autoware_carla_scenario#500 ·
维护者通常 1 天内回复