Skip to content

Commit

Permalink
should fail
Browse files Browse the repository at this point in the history
  • Loading branch information
avantgardnerio committed Dec 9, 2024
1 parent 5dadb25 commit 9839874
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions object_store/src/aws/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions object_store/src/client/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
pub checksum_sha256: Option<String>,
}

impl From<Vec<PartId>> for CompleteMultipartUpload {
Expand All @@ -124,13 +124,13 @@ impl From<Vec<PartId>> 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();
Expand Down

0 comments on commit 9839874

Please sign in to comment.