-
Notifications
You must be signed in to change notification settings - Fork 210
Disable multiple_members option for gzip decoder
#621
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
Conversation
9e78561 to
5fb15ed
Compare
5fb15ed to
ada3d5d
Compare
| frame.map_data(|mut data| data.copy_to_bytes(data.remaining())) | ||
| ))), | ||
| Some(Ok(frame)) => { | ||
| if let Ok(bytes) = frame.into_data() { |
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.
We need to check if frame is not empty before erroring. See seanmonstar/reqwest#2507 (comment)
@seanmonstar Yes, I remember the context now — it started from these two issues/PRs: |
|
In that case, I will re-enable |
multiple_members option for decodersmultiple_members option for gzip decoder
c53bb2d to
397dcce
Compare
397dcce to
86c5b4d
Compare
Motivation
When decompressing a chunked response with extra bytes like in https://github.com/seanmonstar/reqwest/blob/a2aa5a34e48724be0c1089b0f5afe49b82ece30e/tests/gzip.rs#L306, the client hangs and doesn't return error until the server drops connection.
I think this happens because those extra bytes are treated as the start of another gzip frame.
Solution
We can disable
multiple_membersand assert that any frames after decompressing body are trailers.