aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3_copy.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_copy.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_copy.rs')
-rw-r--r--src/api/s3_copy.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/api/s3_copy.rs b/src/api/s3_copy.rs
index 6a8d8f87..0af1b13a 100644
--- a/src/api/s3_copy.rs
+++ b/src/api/s3_copy.rs
@@ -2,7 +2,7 @@ use std::fmt::Write;
use std::sync::Arc;
use chrono::{SecondsFormat, Utc};
-use hyper::Response;
+use hyper::{Body, Response};
use garage_table::*;
use garage_util::data::*;
@@ -13,15 +13,13 @@ use garage_model::garage::Garage;
use garage_model::object_table::*;
use garage_model::version_table::*;
-use crate::http_util::*;
-
pub async fn handle_copy(
garage: Arc<Garage>,
dest_bucket: &str,
dest_key: &str,
source_bucket: &str,
source_key: &str,
-) -> Result<Response<BodyType>, Error> {
+) -> Result<Response<Body>, Error> {
let source_object = match garage
.object_table
.get(&source_bucket.to_string(), &source_key.to_string())
@@ -116,5 +114,5 @@ pub async fn handle_copy(
writeln!(&mut xml, "\t<LastModified>{}</LastModified>", last_modified).unwrap();
writeln!(&mut xml, "</CopyObjectResult>").unwrap();
- Ok(Response::new(Box::new(BytesBody::from(xml.into_bytes()))))
+ Ok(Response::new(Body::from(xml.into_bytes())))
}