Skip to content

fix(body): fix data corruption during decompression (#108)#139

Open
cbonte wants to merge 1 commit intogin-contrib:masterfrom
cbonte:fix-decompress
Open

fix(body): fix data corruption during decompression (#108)#139
cbonte wants to merge 1 commit intogin-contrib:masterfrom
cbonte:fix-decompress

Conversation

@cbonte
Copy link

@cbonte cbonte commented Feb 5, 2026

  • prevent mixed response containing plain text and gzipped data, due to c.Next() calls in DefaultDecompressHandle.
  • prevent EOF while decompressing a buffered request body. This is easily triggered whith long payloads requiring several reads. The issue is that the defered close calls are performed on all the readers, including the top level one, and can close the request before the whole data is read. A workaround consists in not closing the top level reader.

* prevent mixed response containing plain text and gzipped data,
  due to c.Next() calls in DefaultDecompressHandle.
* prevent EOF while decompressing a buffered request body.
  This is easily triggered whith long payloads requiring several reads.
  The issue is that the defered close calls are performed on all the
  readers, including the top level one, and can close the request before
  the whole data is read.
  A workaround consists in not closing the top level reader.
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