From c18c3e71e5f4555bb016938ad21b57e3fdd8b7cf Mon Sep 17 00:00:00 2001 From: Nas Taibi <36194441+nataibi@users.noreply.github.com> Date: Fri, 21 Aug 2020 00:26:05 +0100 Subject: [PATCH] adjust content-type for index.html issue #5 --- templates/copy-artifacts.template.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/copy-artifacts.template.yaml b/templates/copy-artifacts.template.yaml index 8544375f9..7ffc4266e 100644 --- a/templates/copy-artifacts.template.yaml +++ b/templates/copy-artifacts.template.yaml @@ -47,7 +47,10 @@ Resources: 'Bucket': source_bucket, 'Key': key } - s3.copy_object(CopySource=copy_source, Bucket=dest_bucket, Key=key) + if o.find("index.html")!=-1: + s3.copy_object(CopySource=copy_source, Bucket=dest_bucket, Key=key,Metadata={"content-type": "text/html"}) + else: + s3.copy_object(CopySource=copy_source, Bucket=dest_bucket, Key=key) def delete_objects(bucket):