Repository navigation
fix: harden HTTP framing correctness - #24
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dad3407455
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| close_delimited_ = true; | ||
| stage_ = Stage::CloseDelimitedBody; |
There was a problem hiding this comment.
Treat unframed 205 responses as header-terminated
When an HTTP/1.1 server returns 205 Reset Content without framing headers and keeps the connection open, this branch enters CloseDelimitedBody and waits for EOF, so a valid response eventually fails with the configured read timeout. RFC 9110 §15.3.6 defines a 205 response as terminating at the end of its header section; complete it there and leave the connection eligible for reuse rather than requiring the peer to close it.
Useful? React with 👍 / 👎.
Summary
Continues roadmap milestone v0.8 with the HTTP correctness review. This PR focuses on message-boundary safety, status-specific body semantics, chunk syntax, request framing policy, and the timeout/EOF contracts that affect connection reuse.
Response framing
Transfer-Encoding+Content-Lengthconflicts before reuse decisions1xx,101, and204responses where v1 treats them as forbidden protocol input205 Reset Content
Fixes a reuse bug where 205 previously completed immediately after headers even without explicit framing.
New policy:
Content-Length: 0completes and may remain reusableChunked decoding
Request serialization
Content-Length: 0for empty POST/PUT/PATCH requestsTimeout / EOF contract
Documents the current v1 behavior:
UnexpectedEofTests
Adds deterministic coverage for:
Roadmap
Scope
No socket/platform implementation, connection-pool behavior, redirect status policy, TLS, compression, or streaming support is added here.