mirror of
https://github.com/tokio-rs/axum.git
synced 2025-01-01 08:56:15 +01:00
Relax Multipart FromRequest implementation bounds (#1379)
This commit is contained in:
parent
7476dd08cb
commit
c8dbe5a7e9
1 changed files with 9 additions and 2 deletions
|
@ -59,7 +59,8 @@ pub struct Multipart {
|
|||
#[async_trait]
|
||||
impl<S, B> FromRequest<S, B> for Multipart
|
||||
where
|
||||
B: HttpBody<Data = Bytes> + Default + Unpin + Send + 'static,
|
||||
B: HttpBody + Send + 'static,
|
||||
B::Data: Into<Bytes>,
|
||||
B::Error: Into<BoxError>,
|
||||
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<Body>> = Router::new().route("/", post(handler));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue