From 33249717010b1173fc28ba188e5fe6d580fbf393 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 1 May 2020 14:30:50 +0000 Subject: 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) --- src/api/s3_put.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/api/s3_put.rs') 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 { - 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 { + Response::builder() + .header("x-amz-version-id", hex::encode(version_uuid)) + .body(empty_body()) + .unwrap() } pub async fn handle_create_multipart_upload( -- cgit v1.2.3