From 67e90b8fcbc9781fa3bf2d183cd457c2e5267f81 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 25 Feb 2020 18:08:20 +0530 Subject: [PATCH] fix handling of directories in Stat (#3092) Fixes #3089 Fixes #3091 --- cmd/client-s3.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/client-s3.go b/cmd/client-s3.go index 3bcacd9a..94a520d5 100644 --- a/cmd/client-s3.go +++ b/cmd/client-s3.go @@ -1287,7 +1287,7 @@ func (c *s3Client) Stat(isIncomplete, isFetchMeta, isPreserve bool, sse encrypt. if objectStat.Err != nil { return nil, probe.NewError(objectStat.Err) } - if strings.HasSuffix(prefix, string(c.targetURL.Separator)) { + if strings.HasSuffix(objectStat.Key, string(c.targetURL.Separator)) { objectMetadata.URL = *c.targetURL objectMetadata.Type = os.ModeDir if isFetchMeta {