diff --git a/axum/src/extract/multipart.rs b/axum/src/extract/multipart.rs index 70b16207..9d2a47c9 100644 --- a/axum/src/extract/multipart.rs +++ b/axum/src/extract/multipart.rs @@ -59,7 +59,8 @@ pub struct Multipart { #[async_trait] impl FromRequest for Multipart where - B: HttpBody + Default + Unpin + Send + 'static, + B: HttpBody + Send + 'static, + B::Data: Into, B::Error: Into, S: Send + Sync, { @@ -248,7 +249,7 @@ define_rejection! { #[cfg(test)] mod tests { use super::*; - use crate::{response::IntoResponse, routing::post, test_helpers::*, Router}; + use crate::{body::Body, response::IntoResponse, routing::post, test_helpers::*, Router}; #[tokio::test] async fn content_type_with_encoding() { @@ -280,4 +281,10 @@ mod tests { client.post("/").multipart(form).send().await; } + + // No need for this to be a #[test], we just want to make sure it compiles + fn _multipart_from_request_limited() { + async fn handler(_: Multipart) {} + let _app: Router<(), http_body::Limited> = Router::new().route("/", post(handler)); + } }