diff --git a/pkg/object/s3.go b/pkg/object/s3.go index 962167ed5000..059818ce4086 100644 --- a/pkg/object/s3.go +++ b/pkg/object/s3.go @@ -104,11 +104,9 @@ func (s *s3client) Head(key string) (Object, error) { } return nil, err } - var sc string + var sc = "STANDARD" if r.StorageClass != nil { sc = *r.StorageClass - } else { - sc = "STANDARD" } return &obj{ key, @@ -228,12 +226,16 @@ func (s *s3client) List(prefix, marker, delimiter string, limit int64, followLin if !strings.HasPrefix(oKey, prefix) || oKey < marker { return nil, fmt.Errorf("found invalid key %s from List, prefix: %s, marker: %s", oKey, prefix, marker) } + var sc = "STANDARD" + if o.StorageClass != nil { + sc = *o.StorageClass + } objs[i] = &obj{ oKey, *o.Size, *o.LastModified, strings.HasSuffix(oKey, "/"), - *o.StorageClass, + sc, } } if delimiter != "" {