fix: preserve HTTP response integrity and streaming delivery - #29
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation and regression coverage are complete; only a minor documentation nit remains.
Review effort: Lite
Findings: None
What changed in this PR
This pull request improves HTTP response integrity and real-time streaming in the forward proxy.
Changes:
- Abort truncated responses when origin body copying fails.
- Flush unknown-length and SSE responses incrementally.
- Add regression coverage and document forwarding behavior.
| File | Summary |
|---|---|
internal/proxy/http.go |
Implements response-copy error handling and flushing. |
internal/proxy/http_test.go |
Updates stalled-response expectations. |
internal/proxy/http_response_integrity_test.go |
Adds truncation, streaming, and trailer tests. |
internal/proxy/http_response_copy_test.go |
Tests flushing and copy errors. |
docs/DEPLOYMENT.md |
Documents forwarding behavior and source-build release boundaries. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
text/event-stream, allowing small events to arrive while the origin is still open.Regression evidence
io.ErrUnexpectedEOFafter delivering the data prefix.make check, fullmake race, formatting and independent review passed.876c564f872f32de8a2329a8e2ea2b5345ccb261: CI 35812695416 (all 11 jobs including actual container integration and OCI build), CodeQL 35812695428 and Linux netem 35812695436 all completed successfully.Scope
HTTP forward-proxy correctness and real-time streaming only. No protocol, credentials, dependency, transport-controller default, release or tag changes. No claim of general throughput or passive/browser similarity improvement.
Merge verification
413afacedf366f97150149e3c237c35c7cf9289a. Its tree is identical to the tested head:86c5d4c9bba1af575dab220a8c1822bf87141c98.