This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new e9ae021ee feat(s3): validate checksum before making HTTP requests 
(#7296)
e9ae021ee is described below

commit e9ae021ee9a5a08d4eddbb6ad716414f83535801
Author: dentiny <[email protected]>
AuthorDate: Thu Mar 26 08:17:04 2026 -0700

    feat(s3): validate checksum before making HTTP requests (#7296)
---
 core/services/s3/src/core.rs | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/core/services/s3/src/core.rs b/core/services/s3/src/core.rs
index dbb29a5b8..30e763e96 100644
--- a/core/services/s3/src/core.rs
+++ b/core/services/s3/src/core.rs
@@ -833,6 +833,15 @@ impl S3Core {
         req = self.insert_sse_headers(req, true);
 
         // Set checksum type headers.
+        // For multipart upload creation, only CRC32 | CRC32C | SHA1 | SHA256 
| CRC64NVME are accepted.
+        // Reference: 
https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html
+        if matches!(self.checksum_algorithm, Some(ChecksumAlgorithm::Md5)) {
+            return Err(Error::new(
+                ErrorKind::Unsupported,
+                "checksum_algorithm \"md5\" is not supported for multipart 
uploads. \
+                 S3 CreateMultipartUpload only accepts: CRC32, CRC32C, SHA1, 
SHA256.",
+            ));
+        }
         req = self.insert_checksum_type_header(req);
 
         // Inject operation to the request.

Reply via email to