Skip to content

fix(http): preserve chunked request framing - #451

Open
fhgffy wants to merge 1 commit into
nadoo:mainfrom
fhgffy:fix/http-chunked-request-framing
Open

fhgffy wants to merge 1 commit into
nadoo:mainfrom
fhgffy:fix/http-chunked-request-framing

Conversation

@fhgffy

@fhgffy fhgffy commented Oct 13, 2026

Copy link
Copy Markdown

Preserve Transfer-Encoding when forwarding an HTTP request body. The relay copies the original chunked bytes, but cleanHeaders removes their framing header, so the origin sees an empty request body instead of the upload.

A loopback regression test sends a chunked POST through the HTTP handler to a real HTTP server and checks that the origin receives the complete body.

When a transfer coding is present, remove any conflicting Content-Length before forwarding. Header serialization tests cover the conflict and verify that ordinary fixed-length requests keep their length.

Validation (Go 1.27.2, Windows/amd64): go test -p 1 ./... -count=1, go vet -p 1 ./..., and go build -p 1 ./....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant