[Bug]: Oversized JSON requests destroy the socket before returning an error
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- typescript
Research direction
Read src/server/signalling/utils.ts and trace how parseJsonBody() handles requests over 1 MB; then check the callers in src/server/signalling/handlers/rtc.ts and src/server/signalling/server.ts. Compare the JSON body behavior with the multipart upload issue #481 and verify that oversized requests can return a structured 413 response. Pull request #496 is already open for this issue.
Written by the indexing model from the issue text.
Description
Bug Description
parseJsonBody() in src/server/signalling/utils.ts calls req.destroy() when a request exceeds the 1 MB limit, then rejects with Payload too large. The route handlers catch that rejection and try to send a JSON error response, but destroying the request also destroys the shared HTTP socket, so the client cannot receive the response. Oversized JSON requests therefore fail like the oversized file uploads described in #481, across endpoints that use this shared parser.
Steps to Reproduce
- Start Rein.
- Send a JSON
POSTbody larger than 1 MB to a route that usesparseJsonBody(), such asPOST /api/configfrom localhost. - Observe that the connection is reset or the response is empty instead of receiving a structured error.
Expected Behavior
The server should stop buffering once the limit is reached and return 413 Payload Too Large with a clear JSON error. It should not destroy the request socket before the response can be delivered.
Code References
src/server/signalling/utils.ts:parseJsonBody()destroys the request after the byte limit is exceeded.src/server/signalling/handlers/rtc.tsandsrc/server/signalling/server.ts: callers catch the rejection and attempt to respond withjson().
Related
- #481 covers the same socket-destruction behavior in multipart file uploads; this report covers JSON request bodies handled by the shared parser.
- Dominant language
- TypeScript
- Stars
- 55
- Forks
- 120
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 24
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AOSSIE-Org/Rein
-
[Bug]: JSON body null returns 500 on /api/clipboard/copy and /api/clipboard/pastePossibly taken A pull request linked to this issue is open or already merged. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
AOSSIE-Org/Rein#522 · 1 comment ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
AOSSIE-Org/Rein#509 · 3 comments ·
Maintainers usually reply within 2 days
-
[Bug]: Session tokens expire 10 days after creation regardless of use (touchToken is never called)Possibly taken @Ankitavasudev claimed this 12 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
AOSSIE-Org/Rein#466 · 6 comments · 1 assignee ·
Maintainers usually reply within 2 days
-
[Bug]: Uploaded files are saved with garbled non-ASCII names and overwrite existing files with the same namePossibly taken @Aryan-en claimed this 23 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
AOSSIE-Org/Rein#458 · 5 comments ·
Maintainers usually reply within 2 days
-
[Bug]: Missing WebRTC playoutDelayHint introduces 50-100ms artificial latency and redundant MediaStream recreation triggers video pipeline reloadPossibly taken @MPoojaSiyag claimed this 1 day ago. Openbug enhancement
Difficulty 3/5 1-2 days Newbie friendliness 35/100
AOSSIE-Org/Rein#523 · 1 comment ·
Maintainers usually reply within 2 days
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
review-followup
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
griffinwork40/agent-afk#5387 ·
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CodeManufactoryLLC/Code60#358 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
android:plan ios:plan main:plan packages:learn
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day