aboutsummaryrefslogtreecommitdiff
path: root/src/api/signature/streaming.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2024-02-07 15:25:49 +0100
committerAlex Auvolat <alex@adnab.me>2024-02-07 15:32:51 +0100
commite011941964b1c1e0b90f85014d166d64a83ae8e2 (patch)
tree5c5cef9af72d48dd7347922341e43f0013380c60 /src/api/signature/streaming.rs
parent53746b59e525ff5f518ed59d7831b05e2732785d (diff)
downloadgarage-e011941964b1c1e0b90f85014d166d64a83ae8e2.tar.gz
garage-e011941964b1c1e0b90f85014d166d64a83ae8e2.zip
[dep-upgrade-202402] refactor use of BodyStream
Diffstat (limited to 'src/api/signature/streaming.rs')
-rw-r--r--src/api/signature/streaming.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/api/signature/streaming.rs b/src/api/signature/streaming.rs
index ea5a64e2..39147ca0 100644
--- a/src/api/signature/streaming.rs
+++ b/src/api/signature/streaming.rs
@@ -5,7 +5,7 @@ use futures::prelude::*;
use futures::task;
use garage_model::key_table::Key;
use hmac::Mac;
-use http_body_util::{BodyStream, StreamBody};
+use http_body_util::StreamBody;
use hyper::body::{Bytes, Incoming as IncomingBody};
use hyper::Request;
@@ -51,11 +51,9 @@ pub fn parse_streaming_body(
.ok_or_internal_error("Unable to build signing HMAC")?;
Ok(req.map(move |body| {
- let body_stream = BodyStream::new(body)
- .map(|x| x.map(|f| f.into_data().unwrap())) //TODO remove unwrap
- .map_err(Error::from);
+ let stream = body_stream::<_, Error>(body);
let signed_payload_stream =
- SignedPayloadStream::new(body_stream, signing_hmac, date, &scope, signature)
+ SignedPayloadStream::new(stream, signing_hmac, date, &scope, signature)
.map(|x| x.map(hyper::body::Frame::data))
.map_err(Error::from);
ReqBody::new(StreamBody::new(signed_payload_stream))