mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-15 14:56:42 +00:00
fix(GODT-3087): Exclude attachment content-disposition part when determining...
This commit is contained in:
@ -60,6 +60,27 @@ func TestWalkerTypeHandler(t *testing.T) {
|
||||
}, html)
|
||||
}
|
||||
|
||||
func TestWalkerTypeHandler_excludingAttachment(t *testing.T) {
|
||||
p := newTestParser(t, "forwarding_html_attachment.eml")
|
||||
|
||||
html := [][]byte{}
|
||||
plain := [][]byte{}
|
||||
|
||||
walker := p.NewWalker().
|
||||
RegisterContentTypeHandler("text/html", func(p *Part) (err error) {
|
||||
html = append(html, p.Body)
|
||||
return
|
||||
}).
|
||||
RegisterContentTypeHandler("text/plain", func(p *Part) (err error) {
|
||||
plain = append(plain, p.Body)
|
||||
return
|
||||
})
|
||||
|
||||
assert.NoError(t, walker.WalkSkipAttachment())
|
||||
assert.Equal(t, 1, len(plain))
|
||||
assert.Equal(t, 0, len(html))
|
||||
}
|
||||
|
||||
func TestWalkerDispositionHandler(t *testing.T) {
|
||||
p := newTestParser(t, "text_html_octet_attachment.eml")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user