From 8956b5fb559e54adff6f5cd7a363f7b00a76e593 Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 24 Jul 2021 18:16:05 +0100 Subject: [PATCH] Mail: Make checking for headers in DataItem case insensitive For example, the servers I tested this on sent "Subject" which matched what I was checking for. However, some servers can send "SUBJECT" which didn't match and would cause an assertion failure. --- Userland/Applications/Mail/MailWidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Userland/Applications/Mail/MailWidget.cpp b/Userland/Applications/Mail/MailWidget.cpp index 41e35a641d..a7557c4c8c 100644 --- a/Userland/Applications/Mail/MailWidget.cpp +++ b/Userland/Applications/Mail/MailWidget.cpp @@ -298,7 +298,10 @@ void MailWidget::selected_mailbox() return false; if (!data_item.section->headers.has_value()) return false; - return data_item.section->headers->contains_slow(search_header); + auto header_iterator = data_item.section->headers->find_if([&search_header](auto& header) { + return header.equals_ignoring_case(search_header); + }); + return header_iterator != data_item.section->headers->end(); }; auto subject_iterator = body_data.find_if([&data_item_has_header](Tuple>& data) {