melib/envelope: decode other_headers values

pull/234/head
Manos Pitsidianakis 5 years ago
parent 59f7f03d64
commit d9b568cfb4
No known key found for this signature in database
GPG Key ID: 73627C2F690DF710

@ -302,8 +302,16 @@ impl Envelope {
}
} else {
self.other_headers.insert(
String::from_utf8_lossy(name).into(),
String::from_utf8_lossy(value).into(),
String::from_utf8(name.to_vec())
.unwrap_or_else(|err| String::from_utf8_lossy(&err.into_bytes()).into()),
parser::phrase(value)
.to_full_result()
.map(|value| {
String::from_utf8(value).unwrap_or_else(|err| {
String::from_utf8_lossy(&err.into_bytes()).into()
})
})
.unwrap_or_else(|_| String::from_utf8_lossy(value).into()),
);
}
}

Loading…
Cancel
Save