diff --git a/tower-http/src/decompression/body.rs b/tower-http/src/decompression/body.rs index 88197bbf..9378e5ca 100644 --- a/tower-http/src/decompression/body.rs +++ b/tower-http/src/decompression/body.rs @@ -15,7 +15,7 @@ use async_compression::tokio::bufread::ZlibDecoder; use async_compression::tokio::bufread::ZstdDecoder; use bytes::{Buf, Bytes}; use http::HeaderMap; -use http_body::Body; +use http_body::{Body, SizeHint}; use pin_project_lite::pin_project; use std::task::Context; use std::{ @@ -326,6 +326,13 @@ where BodyInnerProj::Zstd { inner } => match inner.0 {}, } } + + fn size_hint(&self) -> SizeHint { + match self.inner { + BodyInner::Identity { ref inner } => inner.size_hint(), + _ => SizeHint::default(), + } + } } #[cfg(feature = "decompression-gzip")]