From 15dc619fb23a484c908d4de9048e9b70783f5e21 Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Sun, 1 May 2016 21:17:06 -0400 Subject: [PATCH] More liberal regrex for S3 region matching. Closes #580. --- moto/s3/responses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moto/s3/responses.py b/moto/s3/responses.py index 3c1d82bce..d465f2432 100644 --- a/moto/s3/responses.py +++ b/moto/s3/responses.py @@ -48,7 +48,7 @@ class ResponseObject(_TemplateEnvironmentMixin): # For localhost, default to path-based buckets return False - path_based = (host == 's3.amazonaws.com' or re.match(r"s3\.([^.]*)\.amazonaws\.com", host)) + path_based = (host == 's3.amazonaws.com' or re.match(r"s3[\.\-]([^.]*)\.amazonaws\.com", host)) return not path_based def is_delete_keys(self, request, path, bucket_name):