Allow ports in k8s service urls for s3 mock

If there is a port in the host for the request, then this if statement
is not tripped.
This commit is contained in:
Daniel Wallace 2020-02-17 17:38:53 -06:00
parent aeb194fc57
commit 01f3b60c09
No known key found for this signature in database
GPG Key ID: 9FD9048A8BD617F2

View File

@ -168,7 +168,7 @@ class ResponseObject(_TemplateEnvironmentMixin, ActionAuthenticatorMixin):
or host.startswith("localhost")
or host.startswith("localstack")
or re.match(r"^[^.]+$", host)
or re.match(r"^.*\.svc\.cluster\.local$", host)
or re.match(r"^.*\.svc\.cluster\.local:?\d*$", host)
):
# Default to path-based buckets for (1) localhost, (2) localstack hosts (e.g. localstack.dev),
# (3) local host names that do not contain a "." (e.g., Docker container host names), or