Skip to content

Commit 33d2afc

Browse files
Simon Thulbournjen20
authored andcommitted
Add headers to output
The original implmentation was missing headers to denote mime version & content transfer encoding, this caused issues with EC2. Signed-off-by: Simon Thulbourn <simon+github@thulbourn.com>
1 parent 16c8750 commit 33d2afc

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

builtin/providers/template/resource_cloudinit_config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ func renderPartsToWriter(parts cloudInitParts, writer io.Writer) error {
170170
}
171171

172172
writer.Write([]byte(fmt.Sprintf("Content-Type: multipart/mixed; boundary=\"%s\"\n", mimeWriter.Boundary())))
173+
writer.Write([]byte("MIME-Version: 1.0\r\n"))
173174

174175
for _, part := range parts {
175176
header := textproto.MIMEHeader{}
@@ -179,6 +180,9 @@ func renderPartsToWriter(parts cloudInitParts, writer io.Writer) error {
179180
header.Set("Content-Type", part.ContentType)
180181
}
181182

183+
header.Set("MIME-Version", "1.0")
184+
header.Set("Content-Transfer-Encoding", "7bit")
185+
182186
if part.Filename != "" {
183187
header.Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, part.Filename))
184188
}

0 commit comments

Comments
 (0)