-
Notifications
You must be signed in to change notification settings - Fork 163
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
Enable multiple_members
for GzipDecoder
#354
Enable multiple_members
for GzipDecoder
#354
Conversation
This commit enables support for `multiple_members` which allows the `GzipDecoder` to support gzip streams consisting of multiple, concatenated gzip's - which in turn is a valid gzip. Before this commit, when using the decompression middleware, the input stream would be closed after reading the first gzip chunk, ignoring the rest of the gzip - meaning the resulting decompressed body could be missing data but still considered "OK". An example of a concatenated gzip: ```bash echo "hello" | gzip > hello.txt.gz echo "world" | gzip > world.txt.gz cat hello.txt.gz world.txt.gz > hello-world.txt.gz gzip -d < hello-world.txt.gz hello world ``` Fixes: tower-rs#353
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I think this looks good. Great that that you also added tests.
Do you wanna update the changelog as well? Then this is good to merge.
Sure, just pushed the changes for the CHANGELOG.md! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
* Enable `multiple_members` for `GzipDecoder` This commit enables support for `multiple_members` which allows the `GzipDecoder` to support gzip streams consisting of multiple, concatenated gzip's - which in turn is a valid gzip. Before this commit, when using the decompression middleware, the input stream would be closed after reading the first gzip chunk, ignoring the rest of the gzip - meaning the resulting decompressed body could be missing data but still considered "OK". An example of a concatenated gzip: ```bash echo "hello" | gzip > hello.txt.gz echo "world" | gzip > world.txt.gz cat hello.txt.gz world.txt.gz > hello-world.txt.gz gzip -d < hello-world.txt.gz hello world ``` Fixes: tower-rs#353 * update changelog for tower-rs#354
This commit enables support for
multiple_members
which allows theGzipDecoder
to support gzip streams consisting of multiple, concatenated gzip's - which in turn is a valid gzip.Before this commit, when using the decompression middleware, the input stream would be closed after reading the first gzip chunk, ignoring the rest of the gzip - meaning the resulting decompressed body could be missing data but still considered "OK".
An example of a concatenated gzip:
Fixes: #353
Motivation
#353
Solution
Set
multiple_members(true)
on theGzipDecoder
.