change updateVersion to only update keys, no deletes (#12032)

there are situations where metadata can have keys
with empty values, preserve existing behavior
This commit is contained in:
Harshavardhana
2021-04-10 09:13:12 -07:00
committed by GitHub
parent d50193d30f
commit 641150f2a2
3 changed files with 12 additions and 13 deletions
+4 -1
View File
@@ -138,7 +138,10 @@ func (fi FileInfo) ToObjectInfo(bucket, object string) ObjectInfo {
objInfo.ETag = extractETag(fi.Metadata)
// Add user tags to the object info
objInfo.UserTags = fi.Metadata[xhttp.AmzObjectTagging]
tags := fi.Metadata[xhttp.AmzObjectTagging]
if len(tags) != 0 {
objInfo.UserTags = tags
}
// Add replication status to the object info
objInfo.ReplicationStatus = replication.StatusType(fi.Metadata[xhttp.AmzBucketReplicationStatus])