Answer 413 instead of cutting the connection when a request body is too large
Los mantenedores suelen responder en 1 día
@PrathamAsrani ya está trabajando en esto.
Desde el 25/10/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
The task
When a request body is larger than its limit (for example an import bigger than MAX_IMPORT_MB), the server should answer 413 Payload too large with its usual JSON error. Today it cuts the connection instead: curl fails with error 56, and the app can only show a generic network error, so the user never learns that the file was simply too big.
The cause is in readBody: after rejecting with a 413, it calls req.destroy(), which closes the socket before the error response can be sent. Stop buffering the body instead, let the 413 response go out, and close the connection only after it (for example with a Connection: close header).
Where to look
server/server.js, functionreadBody(around line 297)tests/api.test.mjs, testimport: replaces the map, validates ids, and enforces MAX_IMPORT_MB: it currently accepts either a 413 or a closed connection, which hides the bug
Reproduce: start the server with MAX_IMPORT_MB=1 and post a 1.3 MB JSON body to /api/import.
Done when
- An oversized body gets a
413response with{"error": "Payload too large"} - The test asserts exactly
413(drop theconnection closedalternative) - The server keeps working for the next request
-
npm testpasses
Mentor
@0b3l1X-SolidGeeks
- Lenguaje dominante
- JavaScript
- Estrellas
- 0
- Forks
- 1
- Merge medio
- 14 min
- PR fusionados (30 d)
- 31
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de SolidGeeks/strata
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
SolidGeeks/strata#21 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 22/100
SolidGeeks/strata#22 ·
Los mantenedores suelen responder en 1 día
-
help wanted
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
SolidGeeks/strata#20 ·
Los mantenedores suelen responder en 1 día
Todos los issues de SolidGeeks/strata
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
enhancement good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
yunaremaia/jsonl-cli#1 · 1 comentario ·
-
agent-ready agent:in-progress backend/api
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 3 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
apex-dev-tools/apex-log-parser#199 ·
Los mantenedores suelen responder en 1 día