Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add streaming field limits to `FormParser`

Aperta
#332 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Kludex ci sta già lavorando.

Dal 4/10/2026.

  • #333 di @Kludex — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
537
Fork
104
Merge medio
3h
PR unite (30g)
4

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Kludex/python-multipart

Tutte le issue di Kludex/python-multipart

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.