fuel
fuel copied to clipboard
204 + Gzip leads to EOFException
Bug Report
Description
If a server returns a 204 No Content
including a Content-Encoding gzip
header, Fuel will throw an EOFException
, because it tries to read a gzip header from an empty body.
To Reproduce
Steps to reproduce the behavior:
Fuel.get("https://faendir.com/test/gzip-204.php").responseString()
Expected behavior
I would expect Fuel to return an empty string here.
FWIW, this is non standard behaviour, but has been reported in other agents like here as well.
We can probably apply the same fix: see if there is content to decode and ignore if there isn't any.
this is non standard behaviour
True, but handling it gracefully would be nice anyways.
We can probably apply the same fix: see if there is content to decode and ignore if there isn't any.
Sounds good.
Oh I just meant to explain why it currently blows up. I followed the RFC very closely to implement everything. We then ran into non standard things android already does so no worries :)