From 759ac083ac38319a4443dff02c8265245b04d4b3 Mon Sep 17 00:00:00 2001 From: Hugo <10965479+hugoghx@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:02:40 +0100 Subject: [PATCH] feat(storage): Drop checksum headers Some non-MinIO services that can use this plugin do not support `x-amz-checksum-algorithm` and/or `x-amz-checksum-sha256`. Important to note that if a SHA256 checksum still comes through in the response, the existing code will verify that it matches what we have locally. --- plugin/service/storage/plugin.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/plugin/service/storage/plugin.go b/plugin/service/storage/plugin.go index 9c05b35..358e321 100644 --- a/plugin/service/storage/plugin.go +++ b/plugin/service/storage/plugin.go @@ -507,13 +507,7 @@ func (sp *StoragePlugin) PutObject(ctx context.Context, req *pb.PutObjectRequest } key := path.Join(bucket.GetBucketPrefix(), req.GetKey()) - res, err := cl.PutObject(ctx, bucket.GetBucketName(), key, file, info.Size(), minio.PutObjectOptions{ - UserMetadata: map[string]string{ - "x-amz-checksum-algorithm": "SHA256", - "x-amz-checksum-sha256": checksum, - }, - DisableMultipart: true, - }) + res, err := cl.PutObject(ctx, bucket.GetBucketName(), key, file, info.Size(), minio.PutObjectOptions{}) if err != nil { return nil, errorToStatus(codes.Internal, fmt.Sprintf("failed to put object into minio: %v", err), err, req).Err() }