From 2c6a967f45a94cce04d625fa182c41501f62cc84 Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Sat, 3 Dec 2016 18:59:28 -0500 Subject: [PATCH] Disable strict_slashes for Flask so that S3 works in server mode. --- moto/s3/urls.py | 4 +--- moto/server.py | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) 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