Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

204 + Gzip leads to EOFException #694

Open
F43nd1r opened this issue Oct 15, 2019 · 3 comments
Open

204 + Gzip leads to EOFException #694

F43nd1r opened this issue Oct 15, 2019 · 3 comments

Comments

@F43nd1r
Copy link

F43nd1r commented Oct 15, 2019

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.

@SleeplessByte
Copy link
Collaborator

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.

@F43nd1r
Copy link
Author

F43nd1r commented Oct 15, 2019

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.

@SleeplessByte
Copy link
Collaborator

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants