mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 04:36:43 +00:00
GODT-1817: Restore old date message feature test + fix
This patch also fixes the message builder to not override other headers that already exist to avoid overriding sanitized header entries.
This commit is contained in:
@ -364,7 +364,10 @@ func writeMultipartEncryptedRFC822(header message.Header, body []byte) ([]byte,
|
||||
entFields := bodyHeader.Fields()
|
||||
|
||||
for entFields.Next() {
|
||||
header.Set(entFields.Key(), entFields.Value())
|
||||
// Only set the header field if it is present. Header sanitation will be overridden otherwise.
|
||||
if !header.Has(entFields.Key()) {
|
||||
header.Set(entFields.Key(), entFields.Value())
|
||||
}
|
||||
}
|
||||
|
||||
if err := textproto.WriteHeader(buf, header.Header); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user