[geary/cherry-pick-737bdba1] Fix headers not being parsed due to case differences
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/cherry-pick-737bdba1] Fix headers not being parsed due to case differences
- Date: Fri, 1 Nov 2019 05:13:07 +0000 (UTC)
commit 25fa056a36f31c651c0b6b409ac1951589d466df
Author: Michael Gratton <mike vee net>
Date: Fri Nov 1 15:43:22 2019 +1100
Fix headers not being parsed due to case differences
Commit 8cd310be broke case-insensitive header parsing since it went
from using GMime's header class to using a Gee.Map for header response
lookup. This patch makes the map use case-insensitive keys.
src/engine/imap/api/imap-folder-session.vala | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/engine/imap/api/imap-folder-session.vala b/src/engine/imap/api/imap-folder-session.vala
index 828fc1da..c6d9a91b 100644
--- a/src/engine/imap/api/imap-folder-session.vala
+++ b/src/engine/imap/api/imap-folder-session.vala
@@ -867,7 +867,11 @@ private class Geary.Imap.FolderSession : Geary.Imap.SessionObject {
// if any headers were requested, convert its fields now
if (header_specifiers != null) {
- Gee.Map<string,string> headers = new Gee.HashMap<string,string>();
+ // Header fields are case insensitive, so use a
+ // case-insensitive map.
+ Gee.Map<string,string> headers = new Gee.HashMap<string,string>(
+ String.stri_hash, String.stri_equal
+ );
foreach (FetchBodyDataSpecifier header_specifier in header_specifiers) {
Memory.Buffer fetched_headers =
fetched_data.body_data_map.get(header_specifier);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]