From c2e313d8995fabaa6a2119079ac387b79a08780a Mon Sep 17 00:00:00 2001 From: Marina Biryukova Date: Thu, 12 Sep 2024 18:28:44 +0300 Subject: [PATCH] [#486] Fix PUT encrypted object Signed-off-by: Marina Biryukova --- api/layer/object.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/layer/object.go b/api/layer/object.go index b8625b3..1b89abf 100644 --- a/api/layer/object.go +++ b/api/layer/object.go @@ -267,7 +267,8 @@ func (n *Layer) PutObject(ctx context.Context, p *PutObjectParams) (*data.Extend if err != nil { return nil, err } - if len(p.ContentMD5) > 0 { + + if !p.Encryption.Enabled() && len(p.ContentMD5) > 0 { headerMd5Hash, err := base64.StdEncoding.DecodeString(p.ContentMD5) if err != nil { return nil, apiErrors.GetAPIError(apiErrors.ErrInvalidDigest)