From 366e557e1cc96a7f9b12c10f28f088d2ef4712cb Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Tue, 15 Sep 2020 13:49:41 +0300 Subject: [PATCH] melib/email: don't do case sensitive eq for mime parameters --- melib/src/email.rs | 2 +- melib/src/email/attachments.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/melib/src/email.rs b/melib/src/email.rs index fd72f5213..89cc1375f 100644 --- a/melib/src/email.rs +++ b/melib/src/email.rs @@ -280,7 +280,7 @@ impl Envelope { builder.set_content_type_from_bytes(value); let mut boundary = None; for (n, v) in params { - if n == b"boundary" { + if n.eq_ignore_ascii_case(b"boundary") { boundary = Some(v); break; } diff --git a/melib/src/email/attachments.rs b/melib/src/email/attachments.rs index e7d95906d..f286ccbe9 100644 --- a/melib/src/email/attachments.rs +++ b/melib/src/email/attachments.rs @@ -390,7 +390,7 @@ impl fmt::Display for Attachment { let name = String::from_utf8_lossy( parameters .iter() - .find(|(name, _)| name == b"name") + .find(|(name, _)| name.eq_ignore_ascii_case(b"name")) .map(|(_, value)| value) .unwrap(), );