1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 17:07:01 +02:00

make AnyBody generic on Body type (#2448)

This commit is contained in:
Rob Ede
2021-11-16 21:41:35 +00:00
committed by GitHub
parent 13cf5a9e44
commit d8cbb879dd
18 changed files with 283 additions and 210 deletions

View File

@@ -7,7 +7,7 @@ use std::{
task::{Context, Poll},
};
use actix_http::body::{Body, MessageBody};
use actix_http::body::{AnyBody, MessageBody};
use actix_service::{Service, Transform};
use futures_core::{future::LocalBoxFuture, ready};
@@ -124,7 +124,7 @@ where
B::Error: Into<Box<dyn StdError + 'static>>,
{
fn map_body(self) -> ServiceResponse {
self.map_body(|_, body| Body::from_message(body))
self.map_body(|_, body| AnyBody::new_boxed(body))
}
}