fix handling of directories in Stat (#3092)

Fixes #3089
Fixes #3091
This commit is contained in:
Harshavardhana
2020-02-25 18:08:20 +05:30
committed by GitHub
parent fd89251270
commit 67e90b8fcb
+1 -1
View File
@@ -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 {