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

Error when server returns status of 204 #115

Closed
NeoPhi opened this issue May 17, 2016 · 4 comments
Closed

Error when server returns status of 204 #115

NeoPhi opened this issue May 17, 2016 · 4 comments

Comments

@NeoPhi
Copy link

NeoPhi commented May 17, 2016

When making a POST request against a server that returns a 204 status code the following error occurs with node v6.1.0 and node-fetch v1.5.2:

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: unexpected end of file
    at Zlib._handle.onerror (zlib.js:370:17)
@bitinn
Copy link
Collaborator

bitinn commented May 17, 2016

I will make a test case for it soon, probably because there is no content to decode, not sure how node.js handle pipeing in this case yet.

@jimmywarting
Copy link
Collaborator

I think this is related to my caching problem where i get 304 not modified and a empty response

@NeoPhi
Copy link
Author

NeoPhi commented May 18, 2016

This only seems to be a problem if the server returns a Content-Encoding: gzip header as part of the 204 response. If I pass the compress: false option to the call, no error is generated.

@bitinn bitinn closed this as completed in d47549e May 25, 2016
@bitinn
Copy link
Collaborator

bitinn commented May 25, 2016

this is now fixed and released as v1.5.3

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

3 participants