From d0e1456be34f39548148af45c2e64a61b3448a59 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Fri, 18 Dec 2020 11:42:34 +0100 Subject: [PATCH] client-s3: Stat() should return data for passed directories (#3539) Co-authored-by: Anis Elleuch --- 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 1e2972e4..568b025d 100644 --- a/cmd/client-s3.go +++ b/cmd/client-s3.go @@ -1423,7 +1423,7 @@ func (c *S3Client) Stat(ctx context.Context, opts StatOptions) (*ClientContent, return nil, probe.NewError(objectStat.Err) } - if objectStat.Key == strings.TrimSuffix(object, string(c.targetURL.Separator)) { + if object == objectStat.Key || object == strings.TrimSuffix(objectStat.Key, string(c.targetURL.Separator)) { return c.objectInfo2ClientContent(bucket, objectStat), nil } break