mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 04:36:43 +00:00
fix: set contentID if present and not explicitly attachment
This commit is contained in:
@ -528,7 +528,17 @@ func parseAttachment(h message.Header) (*pmapi.Attachment, error) {
|
||||
|
||||
// Only set ContentID if it should be inline;
|
||||
// API infers content disposition based on whether ContentID is present.
|
||||
if disp, _, err := h.ContentDisposition(); err == nil && disp == "inline" {
|
||||
// If Content-Disposition is present, we base our decision on that.
|
||||
// Otherwise, if Content-Disposition is missing but there is a ContentID, set it.
|
||||
// (This is necessary because some clients don't set Content-Disposition at all,
|
||||
// so we need to rely on other information to deduce if it's inline or attachment.)
|
||||
if h.Has("Content-Disposition") {
|
||||
if disp, _, err := h.ContentDisposition(); err != nil {
|
||||
return nil, err
|
||||
} else if disp == "inline" {
|
||||
att.ContentID = strings.Trim(h.Get("Content-Id"), " <>")
|
||||
}
|
||||
} else if h.Has("Content-Id") {
|
||||
att.ContentID = strings.Trim(h.Get("Content-Id"), " <>")
|
||||
}
|
||||
|
||||
|
||||
@ -13,3 +13,4 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
|
||||
### Fixed
|
||||
* GODT-787 GODT-978 Fix IE and Bridge importing to sent not showing up in inbox (setting up flags properly).
|
||||
* GODT-1006 Use correct macOS keychain name.
|
||||
* GODT-1009 Set ContentID if present and not explicitly attachment.
|
||||
|
||||
Reference in New Issue
Block a user