From 596b435e57275714b3d37529cc342cacc15a86bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sylvain=20Frai=CC=88sse=CC=81?= Date: Mon, 23 Sep 2013 23:34:33 +0200 Subject: [PATCH] Fix the 'www.' strip changing the lstrip method by the replace --- moto/s3/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moto/s3/utils.py b/moto/s3/utils.py index 765303743..7dd0acccc 100644 --- a/moto/s3/utils.py +++ b/moto/s3/utils.py @@ -9,7 +9,7 @@ def bucket_name_from_url(url): domain = urlparse.urlparse(url).netloc # If 'www' prefixed, strip it. - domain = domain.lstrip("www.") + domain = domain.replace("www.", "") if 'amazonaws.com' in domain: bucket_result = bucket_name_regex.search(domain)