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

Decompress slightly invalid gzip response #239

Closed
wants to merge 1 commit into from

Conversation

gregory90
Copy link
Contributor

Prevents following error when compressed response is slightly invalid/truncated (it happens rarely, but still)

Error: unexpected end of file
  File "zlib.js", line 370, col 17, in Zlib._handle.onerror

@codecov-io
Copy link

codecov-io commented Feb 22, 2017

Codecov Report

Merging #239 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #239      +/-   ##
==========================================
+ Coverage   98.97%   98.97%   +<.01%     
==========================================
  Files           6        6              
  Lines         391      392       +1     
  Branches      117      117              
==========================================
+ Hits          387      388       +1     
  Misses          2        2              
  Partials        2        2
Impacted Files Coverage Δ
src/index.js 97.33% <100%> (+0.03%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 673ebb2...86d834e. Read the comment docs.

@bitinn
Copy link
Collaborator

bitinn commented Feb 22, 2017 via email

@gregory90
Copy link
Contributor Author

Some reference:
nodejs/node#8701
request/request#2492

I'm seeing these errors sometimes, and did get to issues mentioned above. node-fetch doesn't have this implemented. If that's not what you want, don't hesitate to close this PR, but many clients are using this approach. I'm not an expert by any means though:)

@TimothyGu
Copy link
Collaborator

Merged in a1e76b9. Thanks!

@TimothyGu TimothyGu closed this Feb 27, 2017
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

Successfully merging this pull request may close these issues.

None yet

4 participants