From 45a380a807ca496e7aadbb335ea548d6f16c51da Mon Sep 17 00:00:00 2001 From: acsbendi Date: Wed, 24 Jul 2019 21:29:00 +0200 Subject: [PATCH] Fixed host not present in headers for S3 requests. --- moto/s3/responses.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/moto/s3/responses.py b/moto/s3/responses.py index e868b24be..6dafa80a8 100644 --- a/moto/s3/responses.py +++ b/moto/s3/responses.py @@ -189,6 +189,8 @@ class ResponseObject(_TemplateEnvironmentMixin, ActionAuthenticatorMixin): self.method = request.method self.path = self._get_path(request) self.headers = request.headers + if 'host' not in self.headers: + self.headers['host'] = urlparse(full_url).netloc try: response = self._bucket_response(request, full_url, headers) except S3ClientError as s3error: