add forceVirtualHostedStyle for stores which only support virtual hosted style

This commit is contained in:
boxjan authored and Benj Fassbind committed 2022-09-09 09:02:52 +02:00
1 parent b3d9055059
commit 268c39ea8c
7 files changed
+36 -21

No files matched your search

+7 -3
View File
@@ -79,15 +79,19 @@ func NewPublishedStorageRaw(
// NewPublishedStorage creates new instance of PublishedStorage with specified S3 access
// keys, region and bucket name
func NewPublishedStorage(accessKey, secretKey, sessionToken, region, endpoint, bucket, defaultACL, prefix,
storageClass, encryptionMethod string, plusWorkaround, disableMultiDel, forceSigV2, debug bool) (*PublishedStorage, error) {
func NewPublishedStorage(
accessKey, secretKey, sessionToken, region, endpoint, bucket, defaultACL, prefix, storageClass, encryptionMethod string,
plusWorkaround, disableMultiDel, forceSigV2, forceVirtualHostedStyle, debug bool) (*PublishedStorage, error) {
config := &aws.Config{
Region: aws.String(region),
}
if endpoint != "" {
config = config.WithEndpoint(endpoint).WithS3ForcePathStyle(true)
config = config.WithEndpoint(endpoint)
if !forceVirtualHostedStyle {
config = config.WithS3ForcePathStyle(true)
}
}
if accessKey != "" {