From 31dbe61233946310203d393e6c22090d9ba1ca0b Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Sun, 24 Jan 2016 17:15:21 -0500 Subject: [PATCH] Fix s3 url regex. Closes #516. --- 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 a46a20f9e..f27606c90 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("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):