Add user tags when listing with metadata (#16883)

This commit is contained in:
Klaus Post 2023-03-23 10:27:19 -07:00 committed by GitHub
parent 8b0ab6ead6
commit 5e3bfd2148
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -359,6 +359,7 @@ type Object struct {
// UserMetadata user-defined metadata // UserMetadata user-defined metadata
UserMetadata *Metadata `xml:"UserMetadata,omitempty"` UserMetadata *Metadata `xml:"UserMetadata,omitempty"`
UserTags string `xml:"UserTags,omitempty"`
} }
// CopyObjectResponse container returns ETag and LastModified of the successfully copied object // CopyObjectResponse container returns ETag and LastModified of the successfully copied object
@ -626,6 +627,7 @@ func generateListObjectsV2Response(bucket, prefix, token, nextToken, startAfter,
} }
content.Owner = owner content.Owner = owner
if metadata { if metadata {
content.UserTags = object.UserTags
content.UserMetadata = &Metadata{} content.UserMetadata = &Metadata{}
switch kind, _ := crypto.IsEncrypted(object.UserDefined); kind { switch kind, _ := crypto.IsEncrypted(object.UserDefined); kind {
case crypto.S3: case crypto.S3: