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: unexpected end of file #224

Closed
hustcer opened this issue Aug 31, 2016 · 3 comments
Closed

Error: unexpected end of file #224

hustcer opened this issue Aug 31, 2016 · 3 comments

Comments

@hustcer
Copy link

hustcer commented Aug 31, 2016

Just run the following code:

const fs  = require('fs');
const got = require('got');

got.stream('http://www.dfzq.com.cn/dfzq/dfyw/rzrqbdzq.jsp')
   .pipe(fs.createWriteStream('out.html'));

and you will got:

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

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

sindresorhus commented Sep 1, 2016

Seems like a case of the content having no body. (Relevant: request/request#2176).

@hustcer
Copy link
Author

hustcer commented Sep 1, 2016

Is there any workaround? Thanks

@hustcer
Copy link
Author

hustcer commented Sep 3, 2016

May this issue help: ladjs/superagent#857

kevva added a commit to sindresorhus/decompress-response that referenced this issue Sep 6, 2016
sindresorhus pushed a commit to sindresorhus/decompress-response that referenced this issue Sep 6, 2016
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