Enable multiple_members for GzipDecoder#354
Merged
davidpdrsn merged 2 commits intotower-rs:masterfrom Apr 13, 2023
Merged
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
Nehliin
approved these changes
Apr 13, 2023
davidpdrsn
reviewed
Apr 13, 2023
Member
davidpdrsn
left a comment
There was a problem hiding this comment.
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.
Contributor
Author
|
Sure, just pushed the changes for the CHANGELOG.md! |
gezihuzi
pushed a commit
to gezihuzi/tower-http
that referenced
this pull request
Jul 19, 2023
* 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 file contains hidden or 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
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.
This commit enables support for
multiple_memberswhich allows theGzipDecoderto 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.