diff --git a/cmd/object-handlers.go b/cmd/object-handlers.go index e8e2e573e..e72a1c831 100644 --- a/cmd/object-handlers.go +++ b/cmd/object-handlers.go @@ -1273,6 +1273,11 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re // Ensure that metadata does not contain sensitive information crypto.RemoveSensitiveEntries(srcInfo.UserDefined) + // If we see legacy source, metadataOnly we have to overwrite the content. + if srcInfo.Legacy { + srcInfo.metadataOnly = false + } + // Check if x-amz-metadata-directive or x-amz-tagging-directive was not set to REPLACE and source, // destination are same objects. Apply this restriction also when // metadataOnly is true indicating that we are not overwriting the object.