Requests icon indicating copy to clipboard operation
Requests copied to clipboard

Requests class: review and improve decompression methods

Open jrfnl opened this issue 4 years ago • 2 comments

As per #595:

The methods covered via the DecompressionTest test class need a lot more tests, in particular the Requests::compatible_gzinflate() method, which includes code paths currently completely untested and handling of ZIP file format, which when called from Requests::decompress() (which is the only way it is called from within the Requests library itself), can never be reached as the "magic markers" used by ZIP are not included in the Requests::$magic_compression_headers property.

A future iteration should do a more in-depth review of these two method to determine what should be handled by each method and add additional tests.

jrfnl avatar Nov 06 '21 23:11 jrfnl

The test cases in the DecompressionTest::dataDeflate() test look like the byte streams are messed. It looks like these are GZIP headers with ZLIB compressed data. This test scenario needs to be investigated, and this probably also means the code we currently have for decompression is not properly interpreting the headers.

schlessera avatar Nov 10 '21 15:11 schlessera

Other related issues: #135, #152, #153, #437

jrfnl avatar Nov 25 '21 14:11 jrfnl