From d5dfc0006ae0678245bd6ea9a15d5901bd108d35 Mon Sep 17 00:00:00 2001 From: Angira Kekteeva Date: Fri, 9 Jul 2021 00:01:33 +0300 Subject: [PATCH] [#131] Remove metadata from Object in ListObjects Because ListObjects v1 and v2 shouldn't show metadata. Also aws cli doesn't show metadata even we return it. Signed-off-by: Angira Kekteeva --- api/handler/list.go | 2 -- api/handler/response.go | 3 --- 2 files changed, 5 deletions(-) diff --git a/api/handler/list.go b/api/handler/list.go index 9c018e8d..f8324b26 100644 --- a/api/handler/list.go +++ b/api/handler/list.go @@ -202,7 +202,6 @@ func encodeV1(arg *listObjectsArgs, list *layer.ListObjectsInfo) *ListObjectsRes res.Contents = append(res.Contents, Object{ Key: obj.Name, Size: obj.Size, - UserMetadata: obj.Headers, LastModified: obj.Created.Format(time.RFC3339), Owner: Owner{ @@ -265,7 +264,6 @@ func encodeV2(arg *listObjectsArgs, list *layer.ListObjectsInfo) *ListObjectsV2R res.Contents = append(res.Contents, Object{ Key: obj.Name, Size: obj.Size, - UserMetadata: obj.Headers, LastModified: obj.Created.Format(time.RFC3339), Owner: Owner{ diff --git a/api/handler/response.go b/api/handler/response.go index fda7f60d..42f2e556 100644 --- a/api/handler/response.go +++ b/api/handler/response.go @@ -104,9 +104,6 @@ type Object struct { // The class of storage used to store the object. StorageClass string `xml:"StorageClass,omitempty"` - - // UserMetadata user-defined metadata - UserMetadata StringMap `xml:"UserMetadata,omitempty"` } // ObjectVersionResponse container for object version in the response of ListBucketObjectVersionsHandler.