-
Notifications
You must be signed in to change notification settings - Fork 30k
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
ungzipping buffer with trailing garbage throws error #7502
Comments
Python’s
There is, unfortunately, no common behaviour for different kinds of trailing data in browsers; often, trailing garbage will be ignored, but e.g. if it looks like the start of another gzip member, Chrome will just bail out completely (I don’t know why it does that, though). |
Is there anything to do here @addaleax and @bnoordhuis ? |
It's the bad feature, but not the bug. |
Sorry for resurrecting this after 4 years @addaleax, but I wasn't able to find any solution elsewhere. Is there a way to ignore the trailing garbage with the currently available options? I tried various combinations of Example website:
Browser works fine,
But I can't convince Node.js to decompress this payload, aside from |
One site sends a gzipped html page and I try to ungzip page for further processing but zlib throws error
incorrect header check
. Error happens due to extra data after gzipped page. Yes, gzipped data is not valid, since have trailing data, but in other hand, browser eat that normally.Minimal example:
Also live example:
In other languages (for example, python - requests) I can set
windowBits
to16 + zlib.Z_MAX_WINDOWBITS
butnode
strictly restrictedwindowBits
from 0 to 15 even in addon.The text was updated successfully, but these errors were encountered: