Skip to content

Read a gzip body without length from a socket stream - #162

Merged
svenvc merged 2 commits into
svenvc:masterfrom
ApptiveGrid:gzip-body-without-length-over-tls
Sep 24, 2026
Merged

svenvc merged 2 commits into
svenvc:masterfrom
ApptiveGrid:gzip-body-without-length-over-tls

Conversation

@noha

@noha noha commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

A gzip-encoded entity with neither Content-Length nor chunked transfer encoding, i.e. one delimited by closing the connection, was inflated directly from the socket stream. InflateStream asks its source for its #position while refilling, which ZdcSocketStream and ZdcSecureSocketStream do not understand, so reading such a response failed with a MessageNotUnderstood.

The source is now wrapped in a ZnLimitedReadStream in that case too, as it already was for a gzip body with a Content-Length. ZnUnpositionableReadStream stands in for a socket stream in the test.

noha and others added 2 commits September 24, 2026 11:35
A gzip-encoded entity with neither Content-Length nor chunked transfer
encoding, i.e. one delimited by closing the connection, was inflated
directly from the socket stream. InflateStream asks its source for its
#position while refilling, which ZdcSocketStream and ZdcSecureSocketStream
do not understand, so reading such a response failed with a
MessageNotUnderstood.

The source is now wrapped in a ZnLimitedReadStream in that case too, as it
already was for a gzip body with a Content-Length. ZnUnpositionableReadStream
stands in for a socket stream in the test.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Read a gzip body without length from a socket stream
@svenvc
svenvc merged commit 4780c5f into svenvc:master Sep 24, 2026
6 checks passed
@svenvc

svenvc commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Thank you

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.

2 participants