aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3/put.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/s3/put.rs')
-rw-r--r--src/api/s3/put.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/api/s3/put.rs b/src/api/s3/put.rs
index 3d43eee8..17424862 100644
--- a/src/api/s3/put.rs
+++ b/src/api/s3/put.rs
@@ -4,13 +4,13 @@ use std::sync::Arc;
use base64::prelude::*;
use futures::prelude::*;
use futures::try_join;
-use http_body_util::BodyStream;
-use hyper::body::Bytes;
-use hyper::header::{HeaderMap, HeaderValue};
-use hyper::{Request, Response};
use md5::{digest::generic_array::*, Digest as Md5Digest, Md5};
use sha2::Sha256;
+use hyper::body::{Body, Bytes};
+use hyper::header::{HeaderMap, HeaderValue};
+use hyper::{Request, Response};
+
use opentelemetry::{
trace::{FutureExt as OtelFutureExt, TraceContextExt, Tracer},
Context,
@@ -51,14 +51,12 @@ pub async fn handle_put(
None => None,
};
- let body_stream = BodyStream::new(req.into_body())
- .map(|x| x.map(|f| f.into_data().unwrap())) //TODO remove unwrap
- .map_err(Error::from);
+ let stream = body_stream(req.into_body());
save_stream(
garage,
headers,
- body_stream,
+ stream,
bucket,
key,
content_md5,