diff --git a/moto/s3/urls.py b/moto/s3/urls.py index 98686e495..8faad6282 100644 --- a/moto/s3/urls.py +++ b/moto/s3/urls.py @@ -21,9 +21,7 @@ url_paths = { '{0}/$': S3ResponseInstance.bucket_response, # subdomain key of path-based bucket - '{0}/(?P[^/]+)$': ambiguous_response1, - # subdomain key of path-based bucket - '{0}/(?P[^/]+)/$': ambiguous_response2, + '{0}/(?P[^/]+)/?$': S3ResponseInstance.ambiguous_response, # path-based bucket + key '{0}/(?P[^/]+)/(?P.+)': S3ResponseInstance.key_response, } diff --git a/moto/server.py b/moto/server.py index 6e43c47ac..5ee12362e 100644 --- a/moto/server.py +++ b/moto/server.py @@ -113,6 +113,7 @@ def create_backend_app(service): endpoint=endpoint, methods=HTTP_METHODS, view_func=convert_flask_to_httpretty_response(handler), + strict_slashes=False, ) backend_app.test_client_class = AWSTestHelper