aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3_delete.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-07-07 17:15:53 +0200
committerAlex Auvolat <alex@adnab.me>2020-07-07 17:15:53 +0200
commitf22ecb60a8e1848de95e1bd3104b0ceec7058f0c (patch)
tree1e51db048f17295a070aae4025bfa16036a3c0fd /src/api/s3_delete.rs
parent3b0b11085e0501afcc16f6a75632a4d425146158 (diff)
downloadgarage-f22ecb60a8e1848de95e1bd3104b0ceec7058f0c.tar.gz
garage-f22ecb60a8e1848de95e1bd3104b0ceec7058f0c.zip
Update to Hyper 0.13.6 that accepts non-Sync streams in wrap_stream.
Simplifies code and makes it possible to publish on crates.io
Diffstat (limited to 'src/api/s3_delete.rs')
-rw-r--r--src/api/s3_delete.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/api/s3_delete.rs b/src/api/s3_delete.rs
index 60714b0c..91e5e20d 100644
--- a/src/api/s3_delete.rs
+++ b/src/api/s3_delete.rs
@@ -10,7 +10,6 @@ use garage_model::garage::Garage;
use garage_model::object_table::*;
use crate::encoding::*;
-use crate::http_util::*;
async fn handle_delete_internal(
garage: &Garage,
@@ -70,13 +69,13 @@ pub async fn handle_delete(
garage: Arc<Garage>,
bucket: &str,
key: &str,
-) -> Result<Response<BodyType>, Error> {
+) -> Result<Response<Body>, Error> {
let (_deleted_version, delete_marker_version) =
handle_delete_internal(&garage, bucket, key).await?;
Ok(Response::builder()
.header("x-amz-version-id", hex::encode(delete_marker_version))
- .body(empty_body())
+ .body(Body::from(vec![]))
.unwrap())
}
@@ -84,7 +83,7 @@ pub async fn handle_delete_objects(
garage: Arc<Garage>,
bucket: &str,
req: Request<Body>,
-) -> Result<Response<BodyType>, Error> {
+) -> Result<Response<Body>, Error> {
let body = hyper::body::to_bytes(req.into_body()).await?;
let cmd_xml = roxmltree::Document::parse(&std::str::from_utf8(&body)?)?;
let cmd = parse_delete_objects_xml(&cmd_xml)
@@ -130,9 +129,9 @@ pub async fn handle_delete_objects(
writeln!(&mut retxml, "</DeleteObjectsOutput>").unwrap();
- Ok(Response::new(Box::new(BytesBody::from(
+ Ok(Response::new(Body::from(
retxml.into_bytes(),
- ))))
+ )))
}
struct DeleteRequest {