aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3_get.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-07-08 13:33:02 +0200
committerAlex Auvolat <alex@adnab.me>2020-07-08 13:33:02 +0200
commit86fb7bbba5aefc797f359bd84676637f0232b709 (patch)
tree22e90454f0c5ccd50a0e9dbdeec516ddd7955edf /src/api/s3_get.rs
parentf22ecb60a8e1848de95e1bd3104b0ceec7058f0c (diff)
downloadgarage-86fb7bbba5aefc797f359bd84676637f0232b709.tar.gz
garage-86fb7bbba5aefc797f359bd84676637f0232b709.zip
Apply cargo fmt; add trace output when request signature is bad
Diffstat (limited to 'src/api/s3_get.rs')
-rw-r--r--src/api/s3_get.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/api/s3_get.rs b/src/api/s3_get.rs
index 5f2151b5..42cf55d1 100644
--- a/src/api/s3_get.rs
+++ b/src/api/s3_get.rs
@@ -146,7 +146,7 @@ pub async fn handle_get(
})
.buffered(2);
//let body: Body = Box::new(StreamBody::new(Box::pin(body_stream)));
- let body = hyper::body::Body::wrap_stream(body_stream);
+ let body = hyper::body::Body::wrap_stream(body_stream);
Ok(resp_builder.body(body)?)
}
}
@@ -176,9 +176,7 @@ pub async fn handle_get_range(
ObjectVersionData::DeleteMarker => Err(Error::NotFound),
ObjectVersionData::Inline(bytes) => {
if end as usize <= bytes.len() {
- let body: Body = Body::from(
- bytes[begin as usize..end as usize].to_vec(),
- );
+ let body: Body = Body::from(bytes[begin as usize..end as usize].to_vec());
Ok(resp_builder.body(body)?)
} else {
Err(Error::Message(format!("Internal error: requested range not present in inline bytes when it should have been")))
@@ -213,14 +211,14 @@ pub async fn handle_get_range(
} else {
end - block.offset
};
- Result::<Bytes,Error>::Ok(Bytes::from(
+ Result::<Bytes, Error>::Ok(Bytes::from(
data[start_in_block as usize..end_in_block as usize].to_vec(),
))
}
})
.buffered(2);
//let body: Body = Box::new(StreamBody::new(Box::pin(body_stream)));
- let body = hyper::body::Body::wrap_stream(body_stream);
+ let body = hyper::body::Body::wrap_stream(body_stream);
Ok(resp_builder.body(body)?)
}
}