mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4392] [Other] A chunked request body with exactly 64 trailers is refused 400: off-by-one in the trailer loop #1948
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#1948
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?
Originally created by @TheHubUser4860938 on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4392
Problem: serve/server.py (_read_chunked, v0.2.7 lines 6563-6569): after the final chunk,
for _ in range(64):reads "the trailers, including the final blank line" — the terminating blank line must be one of the 64 reads, so a well-formed body with 64 trailer FIELDS (64 lines + blank) exits the loop and raisesBadBody(400, "too many chunked request trailers"). The real allowance is 63 fields. RFC 9112 section 7.1 recommends servers accept at least 256 trailer lines.Environment:
Strata Version: 0.2.7 (source checkout at tag v0.2.7, commit
5e8a4cca; the file discussed is byte-identical to the tag)OS: Linux x86-64
Runtime: Python 3.14
Reported from the Strata-Mnemosyne fork's merged tree; the offending code is upstream's own.
Reproduce (measured against MockEngine on an ephemeral port):
POST /v1/chat/completionswithTransfer-Encoding: chunked, body2\r\nhi\r\n+ 64 xa: b\r\n+\r\n→HTTP 400 ... too many chunked request trailers; 63 fields pass.Expected: accept it (or at least match the documented intent: 64 fields fit inside 64 lines when the blank line is the 65th read).
Actual: 400 + connection close for a valid request; practical blast radius small (proxies/relays that send many trailers).
Reproduction status: measured locally (MockEngine, not the full model boot).
@Niko1221 commented on GitHub (Nov 5, 2026):
Thanks for taking the time to report this.
Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.