From fed97f37e1f0cc2ed8e06f4b76ed0cfcf4a24c97 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sun, 29 Nov 2020 16:38:01 +0100 Subject: [PATCH] ETag patch --- src/api/s3_put.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/api/s3_put.rs b/src/api/s3_put.rs index 6906d758..09c3cdbe 100644 --- a/src/api/s3_put.rs +++ b/src/api/s3_put.rs @@ -273,10 +273,10 @@ impl BodyChunker { } } -pub fn put_response(version_uuid: UUID, etag: String) -> Response { +pub fn put_response(version_uuid: UUID, md5sum_hex: String) -> Response { Response::builder() .header("x-amz-version-id", hex::encode(version_uuid)) - .header("ETag", etag) + .header("ETag", format!("\"{}\"", md5sum_hex)) .body(Body::from(vec![])) .unwrap() } @@ -382,7 +382,11 @@ pub async fn handle_put_part( content_sha256, )?; - Ok(Response::new(Body::from(vec![]))) + let response = Response::builder() + .header("ETag", format!("\"{}\"", hex::encode(md5sum_arr))) + .body(Body::from(vec![])) + .unwrap(); + Ok(response) } pub async fn handle_complete_multipart_upload(