Skip to content

Commit fab70c2

Browse files
committed
imports: prevent empty Content-Type header field
This makes the API choke with "[36026] Imported message is empty".
1 parent 759f6d1 commit fab70c2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

imports/messages.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ func ImportMessage(c *protonmail.Client, r io.Reader) error {
8282
}
8383

8484
var ihdr mail.InlineHeader
85-
ihdr.Set("Content-Type", hdr.Get("Content-Type"))
85+
if hdr.Has("Content-Type") {
86+
ihdr.Set("Content-Type", hdr.Get("Content-Type"))
87+
}
8688
ihdr.Set("Content-Transfer-Encoding", "8bit")
8789

8890
hdr.Del("Content-Type")

0 commit comments

Comments
 (0)