Skip to content

http1connection: Hide compressed content length after decoding - #3690

Open
Sanjays2402 wants to merge 1 commit into
tornadoweb:masterfrom
Sanjays2402:fix/decompressed-content-length
Open

http1connection: Hide compressed content length after decoding#3690
Sanjays2402 wants to merge 1 commit into
tornadoweb:masterfrom
Sanjays2402:fix/decompressed-content-length

Conversation

@Sanjays2402

Copy link
Copy Markdown

Automatic gzip decompression left the upstream Content-Length in response headers even though the body contained the decompressed bytes, so proxying the response could fail with HTTPOutputError.

Pass a header copy downstream to preserve the original framing metadata for HTTP1Connection, then rename Content-Length to X-Consumed-Content-Length alongside the existing Content-Encoding handling. The regression test fails on master and the affected client/server suites pass; the full suite's sole failure also reproduces on unmodified master on macOS/Python 3.14.

Fixes #2743

Gzip decoding replaced the response body but left Content-Length describing
the compressed bytes. Pass a header copy downstream so HTTP framing keeps
the original metadata, then rename Content-Length alongside Content-Encoding.

Add a simple HTTP client regression test for the transformed headers.

Fixes tornadoweb#2743
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.

HTTP client gives incorrect Content-Length for automatically decompressed responses

1 participant