Pathprefix is filtered out properly and delimited as well

master
Harshavardhana 10 years ago
parent 3e4509efeb
commit cc46475c86
  1. 5
      pkg/storage/fs/fs.go

@ -404,12 +404,13 @@ func (storage *storage) ListObjects(bucket string, resources mstorage.BucketReso
resources.CommonPrefixes = appendUniq(resources.CommonPrefixes, delimited)
}
case resources.Delimiter != "" && strings.HasPrefix(name, resources.Prefix):
delimited := delimiter(name, resources.Delimiter)
_internal := strings.TrimPrefix(name, resources.Prefix)
delimited := delimiter(_internal, resources.Delimiter)
switch true {
case delimited == "":
metadata := mstorage.ObjectMetadata{
Bucket: bucket,
Key: name,
Key: _internal,
Created: file.ModTime(),
Size: file.Size(),
ETag: bucket + "#" + name,

Loading…
Cancel
Save