Merge pull request #892 from whummer/fix/local-domain-names

Fix domain handling for local domain names in S3 API
This commit is contained in:
Steve Pulec 2017-04-12 20:42:15 -04:00 committed by GitHub
commit a664af465a

View File

@ -53,8 +53,8 @@ class ResponseObject(_TemplateEnvironmentMixin):
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)