Detect truncated compressed body in all decompressors
CY
18d ago+61+61+01234567890123456789-37-37-01234567890123456789
Summary
Current body decoder only performs EOF checks on certain encoding implementations. When a compressed body is malform or truncated, a DecodingError will be raised only when using zstd or brotlicffi. For bodies compressed with other encodings (gzip, deflate, brotli), the decoder silently returns incomplete data without any warning or error.
This PR applies the checks to other decompressors to make this behavior more consistent. Also adds some improvements to test_decoders test suite.
Checklist
- I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
- I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
- I've updated the documentation accordingly.