Currently if you receive a response with Content-Encoding: br set and no body we get an error because Brotli doesn't like being called on an empty stream.
More generally: we should make sure not to call any decoder if the body is empty.
On reviewing #237 I think we should just call into the decoders, but that we should just make sure that all the decoder implementations correctly handle b"" input, and all correctly return b"" outputs in that case.
Ideally a test case for this issue would be parameterized to ensure correct behavior here from all our decoder classes.
Most helpful comment
On reviewing #237 I think we should just call into the decoders, but that we should just make sure that all the decoder implementations correctly handle
b""input, and all correctly returnb""outputs in that case.Ideally a test case for this issue would be parameterized to ensure correct behavior here from all our decoder classes.