1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-30 16:40:21 +02:00

remove internal usage of Body

This commit is contained in:
Rob Ede
2021-11-16 22:10:30 +00:00
parent d8cbb879dd
commit 668a33c793
23 changed files with 137 additions and 111 deletions

View File

@@ -8,7 +8,7 @@ use std::{
};
use actix_http::{
body::Body,
body::AnyBody,
http::{header, Method, StatusCode, Uri},
RequestHead, RequestHeadType,
};
@@ -95,7 +95,7 @@ where
};
let body_opt = match body {
Body::Bytes(ref b) => Some(b.clone()),
AnyBody::Bytes(ref b) => Some(b.clone()),
_ => None,
};
@@ -192,14 +192,14 @@ where
let body_new = if is_redirect {
// try to reuse body
match body {
Some(ref bytes) => Body::Bytes(bytes.clone()),
// TODO: should this be Body::Empty or Body::None.
_ => Body::empty(),
Some(ref bytes) => AnyBody::Bytes(bytes.clone()),
// TODO: should this be AnyBody::Empty or AnyBody::None.
_ => AnyBody::empty(),
}
} else {
body = None;
// remove body
Body::None
AnyBody::None
};
let mut headers = headers.take().unwrap();