Skip to content

Commit

Permalink
Config takes care of checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
avantgardnerio committed Dec 4, 2024
1 parent c76c1e2 commit 2425826
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions object_store/src/aws/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,10 +616,9 @@ impl S3Client {
&self,
location: &Path,
opts: PutMultipartOpts,
checksum: bool,
) -> Result<MultipartId> {
let mut req = self.request(Method::POST, location);
if self.config.checksum == Some(Checksum::SHA256) && checksum {
if self.config.checksum == Some(Checksum::SHA256) {
req = req.header("x-amz-checksum-algorithm", "SHA256");
}
let response = req
Expand Down
6 changes: 3 additions & 3 deletions object_store/src/aws/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ impl ObjectStore for AmazonS3 {
location: &Path,
opts: PutMultipartOpts,
) -> Result<Box<dyn MultipartUpload>> {
let upload_id = self.client.create_multipart(location, opts, true).await?;
let upload_id = self.client.create_multipart(location, opts).await?;

Ok(Box::new(S3MultiPartUpload {
part_idx: 0,
Expand Down Expand Up @@ -315,7 +315,7 @@ impl ObjectStore for AmazonS3 {
Some(S3CopyIfNotExists::Multipart) => {
let upload_id = self
.client
.create_multipart(to, PutMultipartOpts::default(), false)
.create_multipart(to, PutMultipartOpts::default())
.await?;

let res = async {
Expand Down Expand Up @@ -443,7 +443,7 @@ impl MultipartUpload for S3MultiPartUpload {
impl MultipartStore for AmazonS3 {
async fn create_multipart(&self, path: &Path) -> Result<MultipartId> {
self.client
.create_multipart(path, PutMultipartOpts::default(), true)
.create_multipart(path, PutMultipartOpts::default())
.await
}

Expand Down

0 comments on commit 2425826

Please sign in to comment.