From cc46475c866195764e6187925c985692d3a090d4 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 3 Mar 2015 19:45:52 -0800 Subject: [PATCH] Pathprefix is filtered out properly and delimited as well --- pkg/storage/fs/fs.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/storage/fs/fs.go b/pkg/storage/fs/fs.go index 0e67046ac..0fa261dfc 100644 --- a/pkg/storage/fs/fs.go +++ b/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,