HoneyryderChuck 129bcf1871 fixing decompression issue when last DATA frame is empty
An error arose in decompressing a GZIP body from an HTTP/2 response,
where the second-to-last DATA frame actually sent the last meaningful
data chunk, and the server emitted an additional empty frame with
`end_stream` flag.

This error was introduced in the transition to ruby 3 and RBS
refactorings, when the gzip inflater closes automatically once all the
advertised (in "content-length" header) bytes are successfully
decompressed. In the case described above, the empty chunk still dives
into the decompressor and passed to the now closed ZLib::Stream, which
triggeres an exception.

The fix is to halt decompression early in the chain. Response#write
already knows how to deal with empty frames, so the control should be
passed there.

Fixes #112
2021-01-29 18:09:11 +00:00
..