Multipart request body too large does not set error Status Code
- Lingua principale
- Go
- Stelle
- 10.8k
- Fork
- 1.3k
- Merge medio
- 2g 36m
- PR unite (30g)
- 26
Descrizione
### What happened?
If you upload a file that is too large via the Multipart transport, it returns an error to the client but does not set a non-200 error code.
### What did you expect?
I would expect to write a `http.StatusRequestEntityTooLarge` as the status.
This is the only error in the codebase I could find where we don't specifically set a status:
https://github.com/99designs/gqlgen/blob/d14fd791ab7c64788b041c6ace143e355aa37879/graphql/handler/transport/http_form_multipart.go#L64-L66
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
La issue indica il file specifico e le righe in transport/http_form_multipart.go in cui si verifica l'errore. Inizia esaminando la logica di gestione delle richieste multipart intorno alle righe 64-66. Cerca il punto in cui viene restituito l'errore e assicurati che imposti il codice di stato HTTP su http.StatusRequestEntityTooLarge. Esegui i test esistenti relativi agli upload di file multipart per verificare la correzione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- go
- Ambito
- api, backend
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 65/100