diff --git a/cmd/bucket-replication.go b/cmd/bucket-replication.go index a1bb0b7b9..6da177a50 100644 --- a/cmd/bucket-replication.go +++ b/cmd/bucket-replication.go @@ -702,10 +702,8 @@ func getCopyObjMetadata(oi ObjectInfo, sc string) map[string]string { meta[xhttp.ContentType] = oi.ContentType } - if oi.UserTags != "" { - meta[xhttp.AmzObjectTagging] = oi.UserTags - meta[xhttp.AmzTagDirective] = "REPLACE" - } + meta[xhttp.AmzObjectTagging] = oi.UserTags + meta[xhttp.AmzTagDirective] = "REPLACE" if sc == "" { sc = oi.StorageClass @@ -887,7 +885,7 @@ func getReplicationAction(oi1 ObjectInfo, oi2 minio.ObjectInfo, opType replicati } t, _ := tags.ParseObjectTags(oi1.UserTags) - if !reflect.DeepEqual(oi2.UserTags, t.ToMap()) || (oi2.UserTagCount != len(t.ToMap())) { + if (oi2.UserTagCount > 0 && !reflect.DeepEqual(oi2.UserTags, t.ToMap())) || (oi2.UserTagCount != len(t.ToMap())) { return replicateMetadata }