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: