fux: copy object for encrypted objects (#11490)

This commit is contained in:
Ritesh H Shukla 2021-02-08 19:58:17 -08:00 committed by GitHub
parent 68d299e719
commit 3d74efa6b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1041,7 +1041,7 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re
var encMetadata = make(map[string]string)
if objectAPI.IsEncryptionSupported() {
// Encryption parameters not applicable for this object.
if _, ok := crypto.IsEncrypted(srcInfo.UserDefined); ok && crypto.SSECopy.IsRequested(r.Header) {
if _, ok := crypto.IsEncrypted(srcInfo.UserDefined); !ok && crypto.SSECopy.IsRequested(r.Header) {
writeErrorResponse(ctx, w, toAPIError(ctx, errInvalidEncryptionParameters), r.URL, guessIsBrowserReq(r))
return
}