aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3_put.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-05-01 14:30:50 +0000
committerAlex Auvolat <alex@adnab.me>2020-05-01 14:30:50 +0000
commit33249717010b1173fc28ba188e5fe6d580fbf393 (patch)
treeeb9253a961584ac164fdaae60ba3b84b8e7ae4ab /src/api/s3_put.rs
parent3686f100b7e46d60758e4a1cc70586444ddb5f7a (diff)
downloadgarage-33249717010b1173fc28ba188e5fe6d580fbf393.tar.gz
garage-33249717010b1173fc28ba188e5fe6d580fbf393.zip
Slightly improved S3 compatibility
- ListBucket does not require any of the parameters (delimiter, prefix, max-keys, etc) - URLs are properly percent_decoded - PutObject and DeleteObject calls now answer correctly (empty body, version id in the x-amz-version-id: header)
Diffstat (limited to 'src/api/s3_put.rs')
-rw-r--r--src/api/s3_put.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/api/s3_put.rs b/src/api/s3_put.rs
index e6df5bc0..e1e4c02d 100644
--- a/src/api/s3_put.rs
+++ b/src/api/s3_put.rs
@@ -195,9 +195,11 @@ impl BodyChunker {
}
}
-fn put_response(version_uuid: UUID) -> Response<BodyType> {
- let resp_bytes = format!("{}\n", hex::encode(version_uuid));
- Response::new(Box::new(BytesBody::from(resp_bytes)))
+pub fn put_response(version_uuid: UUID) -> Response<BodyType> {
+ Response::builder()
+ .header("x-amz-version-id", hex::encode(version_uuid))
+ .body(empty_body())
+ .unwrap()
}
pub async fn handle_create_multipart_upload(