Skip to content

Commit

Permalink
Merge pull request #892 from whummer/fix/local-domain-names
Browse files Browse the repository at this point in the history
Fix domain handling for local domain names in S3 API
  • Loading branch information
spulec committed Apr 13, 2017
2 parents 03c4d9f + b8a41c5 commit a664af4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions moto/s3/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def subdomain_based_buckets(self, request):
if not host:
host = urlparse(request.url).netloc

if not host or host.startswith("localhost"):
# For localhost, default to path-based buckets
if not host or host.startswith("localhost") or re.match(r"^[^.]+$", host):
# For localhost or local domain names, default to path-based buckets
return False

match = re.match(r'^([^\[\]:]+)(:\d+)?$', host)
Expand Down

0 comments on commit a664af4

Please sign in to comment.