mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2026-02-13 12:28:33 +00:00
GODT-1141 Use attachment name from content type if not specified in content disposition
This commit is contained in:
committed by
Jakub Cuth
parent
4038752a9a
commit
ee961ae4a8
@ -239,6 +239,24 @@ func TestParseTextPlainWithOctetAttachmentBadFilename(t *testing.T) {
|
||||
assert.Equal(t, "attachment.bin", m.Attachments[0].Name)
|
||||
}
|
||||
|
||||
func TestParseTextPlainWithOctetAttachmentNameInContentType(t *testing.T) {
|
||||
f := getFileReader("text_plain_octet_attachment_name_in_contenttype.eml")
|
||||
|
||||
m, _, _, _, err := Parse(f) //nolint[dogsled]
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, "attachment-contenttype.txt", m.Attachments[0].Name)
|
||||
}
|
||||
|
||||
func TestParseTextPlainWithOctetAttachmentNameConflict(t *testing.T) {
|
||||
f := getFileReader("text_plain_octet_attachment_name_conflict.eml")
|
||||
|
||||
m, _, _, _, err := Parse(f) //nolint[dogsled]
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, "attachment-disposition.txt", m.Attachments[0].Name)
|
||||
}
|
||||
|
||||
func TestParseTextPlainWithPlainAttachment(t *testing.T) {
|
||||
f := getFileReader("text_plain_plain_attachment.eml")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user