Switch to MultiGzDecoder
This is more correct, since all gzip streams can consist of multiple members. It has the happy side effect that it causes gzipped responses to reliably return their streams to the pool.
This commit is contained in:
@@ -22,7 +22,7 @@ use serde::de::DeserializeOwned;
|
|||||||
use encoding_rs::Encoding;
|
use encoding_rs::Encoding;
|
||||||
|
|
||||||
#[cfg(feature = "gzip")]
|
#[cfg(feature = "gzip")]
|
||||||
use flate2::read::GzDecoder;
|
use flate2::read::MultiGzDecoder;
|
||||||
|
|
||||||
#[cfg(feature = "brotli")]
|
#[cfg(feature = "brotli")]
|
||||||
use brotli_decompressor::Decompressor as BrotliDecoder;
|
use brotli_decompressor::Decompressor as BrotliDecoder;
|
||||||
@@ -600,7 +600,7 @@ impl Compression {
|
|||||||
#[cfg(feature = "brotli")]
|
#[cfg(feature = "brotli")]
|
||||||
Compression::Brotli => Box::new(BrotliDecoder::new(reader, 4096)),
|
Compression::Brotli => Box::new(BrotliDecoder::new(reader, 4096)),
|
||||||
#[cfg(feature = "gzip")]
|
#[cfg(feature = "gzip")]
|
||||||
Compression::Gzip => Box::new(GzDecoder::new(reader)),
|
Compression::Gzip => Box::new(MultiGzDecoder::new(reader)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user