mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1583] [CLOSED] fix(server): reject incomplete chunked request trailers #3545
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3545
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1583
Author: @hulkbig
Created: 10/8/2026
Status: ❌ Closed
Base:
main← Head:fix/reject-incomplete-http-bodies-20261008📝 Commits (2)
2602760Reject incomplete HTTP request body framinge93ef94Limit body framing fix to incomplete chunked trailers📊 Changes
2 files changed (+51 additions, -5 deletions)
View changed files
📝
serve/server.py(+7 -4)📝
serve/test_chunked_body.py(+44 -1)📄 Description
Summary
Reject incomplete chunked request framing before applying the decoded body.
_read_chunkedcurrently accepts EOF or whitespace as a terminal blank line and returns successfully when its trailer-read limit is exhausted. An otherwise valid JSON body can therefore change/settingsdespite incomplete framing.What changed
\r\n, complete CRLF-terminated trailer lines, and a terminator within the existing 64-read cap.Reproduction: send a chunked
/settingsPOST containing{"defaults":{"temperature":0.5}}, end after0\r\nwithout the final blank line, and half-close the sending side. The baseline applies the settings with HTTP 200; this change returns 400 without applying them.Validation
serve.test_chunked_bodytests successfully.disk_io_counters()returnsNone) and 11 skips. The full suite is not green in this environment.py_compileandgit diff --checkpass.Scope
This complements #1126 by fixing chunked trailer parsing. The Content-Length
_bodypath is unchanged to avoid duplicating its ongoing validation work.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.