Answer 413 instead of cutting the connection when a request body is too large
メンテナーはふだん 1 日以内に返信
@PrathamAsrani がすでに取り組んでいます。
2026年10月25日 から。
評価
この issue はまだ評価されていません。
説明
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
- 主要言語
- JavaScript
- スター
- 0
- フォーク
- 1
- 平均マージ
- 14分
- マージ済み PR(30日)
- 31
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SolidGeeks/strata のほかの issue
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
SolidGeeks/strata#21 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 22/100
SolidGeeks/strata#22 ·
メンテナーはふだん 1 日以内に返信
-
help wanted
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
SolidGeeks/strata#20 ·
メンテナーはふだん 1 日以内に返信
SolidGeeks/strata の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
yunaremaia/jsonl-cli#1 · コメント 1 件 ·
-
agent-ready agent:in-progress backend/api
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apex-dev-tools/apex-log-parser#199 ·
メンテナーはふだん 1 日以内に返信