mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-11 05:06:51 +00:00
GODT-1193: Don't doubly encode parts
This commit is contained in:
@ -85,11 +85,14 @@ func readHeaderBody(b []byte) (*textproto.Header, []byte, error) {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
lines := HeaderLines(rawHeader)
|
||||
|
||||
var header textproto.Header
|
||||
|
||||
for _, line := range HeaderLines(rawHeader) {
|
||||
if len(bytes.TrimSpace(line)) > 0 {
|
||||
header.AddRaw(line)
|
||||
// We add lines in reverse so that calling textproto.WriteHeader later writes with the correct order.
|
||||
for i := len(lines) - 1; i >= 0; i-- {
|
||||
if len(bytes.TrimSpace(lines[i])) > 0 {
|
||||
header.AddRaw(lines[i])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user