forked from Silverfish/proton-bridge
fix(GODT-3087): Exclude attachment content-disposition part when determining...
This commit is contained in:
@ -54,7 +54,7 @@ func (p *Part) ContentType() (string, map[string]string, error) {
|
||||
}
|
||||
|
||||
func (p *Part) ContentDisposition() (string, map[string]string, error) {
|
||||
return p.Header.ContentDisposition()
|
||||
return pmmime.ParseMediaType(p.Header.Get("Content-Disposition"))
|
||||
}
|
||||
|
||||
func (p *Part) HasContentID() bool {
|
||||
@ -209,6 +209,14 @@ func (p *Part) isMultipartMixedOrRelated() bool {
|
||||
return t == "multipart/mixed" || t == "multipart/related"
|
||||
}
|
||||
|
||||
func (p *Part) isAttachment() bool {
|
||||
disp, _, err := p.ContentDisposition()
|
||||
if err != nil {
|
||||
disp = ""
|
||||
}
|
||||
return disp == "attachment"
|
||||
}
|
||||
|
||||
func getContentHeaders(header message.Header) message.Header {
|
||||
var res message.Header
|
||||
|
||||
|
||||
Reference in New Issue
Block a user