fix: reject unsupported checksum assertions

Reject unimplemented x-amz-checksum value and trailer names instead of accepting uploads without verification. Apply the same contract to PutObject, multipart initiation and parts, CopyObject, and UploadPartCopy while preserving the five supported algorithms.

Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
Feng Ruohang
2026-08-29 17:23:26 +08:00
parent 04d3d316d2
commit 7c103389f5
5 changed files with 227 additions and 9 deletions
+3
View File
@@ -439,6 +439,9 @@ func putOptsFromHeaders(ctx context.Context, hdr http.Header, metadata map[strin
// get ObjectOptions for Copy calls with encryption headers provided on the target side and source side metadata
func copyDstOpts(ctx context.Context, r *http.Request, bucket, object string, metadata map[string]string) (opts ObjectOptions, err error) {
if _, err := hash.GetContentChecksum(r.Header); err != nil {
return opts, err
}
return putOptsFromReq(ctx, r, bucket, object, metadata)
}