diff --git a/tower-http/src/body.rs b/tower-http/src/body.rs index 815a0d10..77c3473d 100644 --- a/tower-http/src/body.rs +++ b/tower-http/src/body.rs @@ -103,6 +103,12 @@ where } } +impl From> for http_body_util::combinators::UnsyncBoxBody { + fn from(body: UnsyncBoxBody) -> Self { + body.inner + } +} + impl UnsyncBoxBody { #[allow(dead_code)] pub(crate) fn new(inner: http_body_util::combinators::UnsyncBoxBody) -> Self { diff --git a/tower-http/src/services/fs/serve_dir/mod.rs b/tower-http/src/services/fs/serve_dir/mod.rs index 61b956d1..02e3997d 100644 --- a/tower-http/src/services/fs/serve_dir/mod.rs +++ b/tower-http/src/services/fs/serve_dir/mod.rs @@ -493,6 +493,12 @@ opaque_body! { pub type ResponseBody = UnsyncBoxBody; } +impl From for http_body_util::combinators::UnsyncBoxBody { + fn from(body: ResponseBody) -> Self { + body.inner.inner + } +} + /// The default fallback service used with [`ServeDir`]. #[derive(Debug, Clone, Copy)] pub struct DefaultServeDirFallback(Infallible);