diff options
| author | ruitao.liu <ruitao.liu@cloudminds.com> | 2020-10-29 14:57:19 +0800 |
|---|---|---|
| committer | ruitao.liu <ruitao.liu@cloudminds.com> | 2020-10-29 14:57:19 +0800 |
| commit | b917be79559ec171f351ac842f9d4c20bb335e41 (patch) | |
| tree | 9f5a814bec92823e4552f9396c51cfc19394861e /weed/s3api | |
| parent | 2dcc178d0ae20a013a901e4b4472dc9d8843ba59 (diff) | |
| download | seaweedfs-b917be79559ec171f351ac842f9d4c20bb335e41.tar.xz seaweedfs-b917be79559ec171f351ac842f9d4c20bb335e41.zip | |
S3 bucket list, response with uploaded storageclass.
Diffstat (limited to 'weed/s3api')
| -rw-r--r-- | weed/s3api/s3api_objects_list_handlers.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/weed/s3api/s3api_objects_list_handlers.go b/weed/s3api/s3api_objects_list_handlers.go index 23406d6df..d291b588c 100644 --- a/weed/s3api/s3api_objects_list_handlers.go +++ b/weed/s3api/s3api_objects_list_handlers.go @@ -4,7 +4,6 @@ import ( "context" "encoding/xml" "fmt" - "github.com/chrislusf/seaweedfs/weed/s3api/s3err" "io" "net/http" "net/url" @@ -13,6 +12,10 @@ import ( "strings" "time" + "github.com/chrislusf/seaweedfs/weed/util" + + "github.com/chrislusf/seaweedfs/weed/s3api/s3err" + "github.com/chrislusf/seaweedfs/weed/filer" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" ) @@ -137,6 +140,10 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m }) } } else { + storageClass := "STANDARD" + if v, ok := entry.Extended[util.AmzStorageClass]; ok { + storageClass = string(v) + } contents = append(contents, ListEntry{ Key: fmt.Sprintf("%s/%s", dir, entry.Name)[len(bucketPrefix):], LastModified: time.Unix(entry.Attributes.Mtime, 0).UTC(), @@ -146,7 +153,7 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m ID: fmt.Sprintf("%x", entry.Attributes.Uid), DisplayName: entry.Attributes.UserName, }, - StorageClass: "STANDARD", + StorageClass: StorageClass(storageClass), }) } }) |
