diff options
author | Alex Auvolat <alex@adnab.me> | 2020-11-29 16:38:01 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-11-29 16:38:01 +0100 |
commit | fed97f37e1f0cc2ed8e06f4b76ed0cfcf4a24c97 (patch) | |
tree | 0c1ec4054a58e82e89406d7eff5f1a74e655f715 /src/api/s3_put.rs | |
parent | 601ae25ad27d99c524691d5284e56b2e61545979 (diff) | |
download | garage-fed97f37e1f0cc2ed8e06f4b76ed0cfcf4a24c97.tar.gz garage-fed97f37e1f0cc2ed8e06f4b76ed0cfcf4a24c97.zip |
ETag patch
Diffstat (limited to 'src/api/s3_put.rs')
-rw-r--r-- | src/api/s3_put.rs | 10 |
1 files 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<Body> { +pub fn put_response(version_uuid: UUID, md5sum_hex: String) -> Response<Body> { 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( |