-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
More lenient gzip decompression #2492
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addaleax
force-pushed
the
lenient-gzip
branch
from
December 21, 2016 06:30
25dfff5
to
a008d63
Compare
I can confirm that the issue: #2482 is fixed with this PR |
Be explicitly lenient with gzip decompression by always requesting `zlib` to flush the input data and never explicitly ending the `zlib` input. The behavioural difference is that on Node ≥ 6, which has a slightly stricter gzip decoding process than previous Node versions, malformed but otherwise acceptable server responses are still properly decompressed (the most common example being a missing checksum at the stream end). This aligns behaviour with cURL, which always uses the `Z_SYNC_FLUSH` flag for decompression. On the downside, accidental truncation of a response is no longer detected on the compression layer. Ref: nodejs/node#8701 (comment) Fixes: request#2482
addaleax
force-pushed
the
lenient-gzip
branch
from
December 21, 2016 10:28
a008d63
to
71081b6
Compare
Awesome, I’ve added a |
VisualFox
added a commit
to VisualFox/iframely
that referenced
this pull request
Jan 24, 2017
This fix an issue with zlib: unexpected end of file with node v7.2.1 - Follow the PR: More lenient gzip decompression #2492 request/request#2492 -
TimothyGu
pushed a commit
to node-fetch/node-fetch
that referenced
this pull request
Feb 27, 2017
This was referenced Mar 19, 2018
fatboy0112
added a commit
to fatboy0112/node-fetch
that referenced
this pull request
Sep 22, 2023
Ref: nodejs/node#8701 (comment) Ref: request/request#2482 Ref: request/request#2492 Fixes: http://www.mantovanispa.it Fixes: #139
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Be explicitly lenient with gzip decompression by always requesting
zlib
to flush the input data and never explicitly ending thezlib
input.The behavioural difference is that on Node ≥ 6, which has a slightly
stricter gzip decoding process than previous Node versions, malformed
but otherwise acceptable server responses are still properly
decompressed (the most common example being a missing checksum
at the stream end).
This aligns behaviour with cURL, which always uses the
Z_SYNC_FLUSH
flag for decompression.
On the downside, accidental truncation of a response is no longer
detected on the compression layer.
Ref: nodejs/node#8701 (comment)