Skip to content

Fix duplicate Transfer-Encoding: chunked on HTTP/1.1 responses#616

Merged
haga-rak merged 1 commit into
mainfrom
fix/duplicate-transfer-encoding-615
Apr 11, 2026
Merged

Fix duplicate Transfer-Encoding: chunked on HTTP/1.1 responses#616
haga-rak merged 1 commit into
mainfrom
fix/duplicate-transfer-encoding-615

Conversation

@haga-rak
Copy link
Copy Markdown
Owner

Summary

  • Header.ForceTransferChunked() unconditionally appended a Transfer-Encoding: chunked header, producing a duplicate when the upstream HTTP/1.1 response already carried one. Strict clients such as Go net/http reject the response with too many transfer encodings: ["chunked" "chunked"].
  • Fix: make ForceTransferChunked() idempotent by returning early when ChunkedBody is already true. The guard lives in Header rather than at the call site in ProxyOrchestrator so all current and future callers are protected.
  • Added a regression test that reproduces the bug against https://noaa-goes16.s3.amazonaws.com/ (the origin reported in the issue) with ForceHttp11Action pinning the upstream leg to HTTP/1.1.

Refs #615

Header.ForceTransferChunked() unconditionally appended a
Transfer-Encoding: chunked header, producing a duplicate when the
upstream HTTP/1.1 response already carried one. Strict clients (Go
net/http) reject such responses. Make the method idempotent by
returning early when ChunkedBody is already true.
@haga-rak haga-rak merged commit 80e3575 into main Apr 11, 2026
2 checks passed
@haga-rak haga-rak added the bug Something isn't working label Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant