fix: legacy object should be overwritten for metadataOnly updates (#12012)

This commit is contained in:
Harshavardhana 2021-04-08 14:29:27 -07:00
parent 4c22e0ca6c
commit 06989f0e8f

View file

@ -1271,6 +1271,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.