committed by
kannappanr
parent
29f2dbca6b
commit
64ef3a4e14
-10
@@ -13,16 +13,6 @@ matrix:
|
||||
- diff -au <(gofmt -d *.go) <(printf "")
|
||||
- diff -au <(gofmt -d cmd) <(printf "")
|
||||
- diff -au <(gofmt -d pkg) <(printf "")
|
||||
- os: linux-ppc64le
|
||||
env:
|
||||
- ARCH=ppc64le
|
||||
go: 1.10.1
|
||||
script:
|
||||
- make test
|
||||
- make coverage
|
||||
- diff -au <(gofmt -d *.go) <(printf "")
|
||||
- diff -au <(gofmt -d cmd) <(printf "")
|
||||
- diff -au <(gofmt -d pkg) <(printf "")
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
+15
-17
@@ -989,7 +989,21 @@ func (c *s3Client) Stat(isIncomplete, isFetchMeta bool, sseKey string) (*clientC
|
||||
if objectStat.Err != nil {
|
||||
return nil, probe.NewError(objectStat.Err)
|
||||
}
|
||||
if objectStat.Key == object {
|
||||
if strings.HasSuffix(objectStat.Key, string(c.targetURL.Separator)) {
|
||||
objectMetadata.URL = *c.targetURL
|
||||
objectMetadata.Type = os.ModeDir
|
||||
|
||||
if isFetchMeta {
|
||||
stat, err := c.getObjectStat(bucket, object, opts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
objectMetadata.ETag = stat.ETag
|
||||
objectMetadata.Metadata = stat.Metadata
|
||||
objectMetadata.EncryptionHeaders = stat.EncryptionHeaders
|
||||
}
|
||||
return objectMetadata, nil
|
||||
} else if objectStat.Key == object {
|
||||
objectMetadata.URL = *c.targetURL
|
||||
objectMetadata.Time = objectStat.LastModified
|
||||
objectMetadata.Size = objectStat.Size
|
||||
@@ -1007,22 +1021,6 @@ func (c *s3Client) Stat(isIncomplete, isFetchMeta bool, sseKey string) (*clientC
|
||||
}
|
||||
return objectMetadata, nil
|
||||
}
|
||||
|
||||
if strings.HasSuffix(objectStat.Key, string(c.targetURL.Separator)) {
|
||||
objectMetadata.URL = *c.targetURL
|
||||
objectMetadata.Type = os.ModeDir
|
||||
|
||||
if isFetchMeta {
|
||||
stat, err := c.getObjectStat(bucket, object, opts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
objectMetadata.ETag = stat.ETag
|
||||
objectMetadata.Metadata = stat.Metadata
|
||||
objectMetadata.EncryptionHeaders = stat.EncryptionHeaders
|
||||
}
|
||||
return objectMetadata, nil
|
||||
}
|
||||
}
|
||||
return c.getObjectStat(bucket, object, opts)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user