summaryrefslogtreecommitdiffstats
path: root/api4/apitestlib.go
diff options
context:
space:
mode:
Diffstat (limited to 'api4/apitestlib.go')
-rw-r--r--api4/apitestlib.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/api4/apitestlib.go b/api4/apitestlib.go
index 7075488cb..ef200bf2f 100644
--- a/api4/apitestlib.go
+++ b/api4/apitestlib.go
@@ -626,13 +626,21 @@ func readTestFile(name string) ([]byte, error) {
}
}
+func s3New(endpoint, accessKey, secretKey string, secure bool, signV2 bool) (*s3.Client, error) {
+ if signV2 {
+ return s3.NewV2(endpoint, accessKey, secretKey, secure)
+ }
+ return s3.NewV4(endpoint, accessKey, secretKey, secure)
+}
+
func cleanupTestFile(info *model.FileInfo) error {
if utils.Cfg.FileSettings.DriverName == model.IMAGE_DRIVER_S3 {
endpoint := utils.Cfg.FileSettings.AmazonS3Endpoint
accessKey := utils.Cfg.FileSettings.AmazonS3AccessKeyId
secretKey := utils.Cfg.FileSettings.AmazonS3SecretAccessKey
secure := *utils.Cfg.FileSettings.AmazonS3SSL
- s3Clnt, err := s3.New(endpoint, accessKey, secretKey, secure)
+ signV2 := *utils.Cfg.FileSettings.AmazonS3SignV2
+ s3Clnt, err := s3New(endpoint, accessKey, secretKey, secure, signV2)
if err != nil {
return err
}