Skip to content

Commit 60268a9

Browse files
authored
Merge pull request #41 from MerginMaps/fix-39
Fix amazonaws base url
2 parents 3987743 + ef60296 commit 60268a9

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,13 @@ def __init__(self, config):
102102

103103
# construct base url for bucket
104104
scheme = "https://" if config.as_bool("minio.secure") else "http://"
105-
self.base_url = scheme + config.minio.endpoint + "/" + self.bucket
105+
106+
if config.minio.region and "amazonaws" in config.minio.endpoint.lower():
107+
self.base_url = (
108+
f"{scheme}{self.bucket}.s3.{config.minio.region}.amazonaws.com"
109+
)
110+
else:
111+
self.base_url = scheme + config.minio.endpoint + "/" + self.bucket
106112
except S3Error as e:
107113
raise DriverError("MinIO driver init error: " + str(e))
108114

0 commit comments

Comments
 (0)