From f54e426bb15bbf30a7bce67eb8945b63a3b70af7 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Sun, 2 Oct 2016 05:32:22 +0100 Subject: [PATCH] Do not return S3 empty directories in recursive listing (#1846) --- cmd/client-s3.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/client-s3.go b/cmd/client-s3.go index 39ca7d9b..a1ce8c74 100644 --- a/cmd/client-s3.go +++ b/cmd/client-s3.go @@ -1065,6 +1065,10 @@ func (c *s3Client) listRecursiveInRoutine(contentCh chan *clientContent) { } continue } + // Ignore S3 empty directories + if object.Size == 0 && strings.HasSuffix(object.Key, "/") { + continue + } content := &clientContent{} url := *c.targetURL // Join bucket and incoming object key.