Requests class: review and improve decompression methods
As per #595:
The methods covered via the
DecompressionTesttest class need a lot more tests, in particular theRequests::compatible_gzinflate()method, which includes code paths currently completely untested and handling of ZIP file format, which when called fromRequests::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 theRequests::$magic_compression_headersproperty.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.
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.
Other related issues: #135, #152, #153, #437