From 3cffc782e9548ae08d676af516845b3b4ac1228e 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 4d3c92c..0a2b6de 100644 --- a/api/layer/object.go +++ b/api/layer/object.go @@ -277,7 +277,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)