From 98398744e9bb58d4e1fafb80045bf0b6be90880d Mon Sep 17 00:00:00 2001 From: Brent Gardner Date: Mon, 9 Dec 2024 10:31:11 -0700 Subject: [PATCH] should fail --- object_store/src/aws/client.rs | 7 +++++-- object_store/src/client/s3.rs | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/object_store/src/aws/client.rs b/object_store/src/aws/client.rs index cc7e1418d7a..81015e82b39 100644 --- a/object_store/src/aws/client.rs +++ b/object_store/src/aws/client.rs @@ -676,7 +676,7 @@ impl S3Client { request = request.with_encryption_headers(); } let response = request.send().await?; - let checksum = response + let checksum_sha256 = response .headers() .get(SHA256_CHECKSUM) .and_then(|v| v.to_str().ok()) @@ -696,7 +696,10 @@ impl S3Client { }; let content_id = if self.config.checksum == Some(Checksum::SHA256) { - let meta = PartMetadata { e_tag, checksum }; + let meta = PartMetadata { + e_tag, + checksum_sha256, + }; quick_xml::se::to_string(&meta).unwrap() } else { e_tag diff --git a/object_store/src/client/s3.rs b/object_store/src/client/s3.rs index e49e59040d3..7fe956b2376 100644 --- a/object_store/src/client/s3.rs +++ b/object_store/src/client/s3.rs @@ -110,7 +110,7 @@ pub(crate) struct CompleteMultipartUpload { pub(crate) struct PartMetadata { pub e_tag: String, #[serde(skip_serializing_if = "Option::is_none")] - pub checksum: Option, + pub checksum_sha256: Option, } impl From> for CompleteMultipartUpload { @@ -124,13 +124,13 @@ impl From> for CompleteMultipartUpload { // fallback to old way Err(_) => PartMetadata { e_tag: part.content_id.clone(), - checksum: None, + checksum_sha256: None, }, }; MultipartPart { e_tag: md.e_tag, part_number: part_idx + 1, - checksum_sha256: md.checksum, + checksum_sha256: md.checksum_sha256, } }) .collect();