From 29e0727b583f53d5fa6abce93ad6c6a57c4621f6 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sat, 11 Apr 2020 20:20:30 -0700 Subject: [PATCH] fix: regression in CopyObject not preserving ETag in --compat (#9322) issue found after `git bisect` to commit db4195361876fbe2410236bce55f173da3ef3b2b --- cmd/object-handlers.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/object-handlers.go b/cmd/object-handlers.go index 89e4ac3f0..39145e85a 100644 --- a/cmd/object-handlers.go +++ b/cmd/object-handlers.go @@ -993,7 +993,9 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re return } - pReader = NewPutObjReader(rawReader, srcInfo.Reader, &objEncKey) + if isTargetEncrypted { + pReader = NewPutObjReader(rawReader, srcInfo.Reader, &objEncKey) + } } }