]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Process charset in content type
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 12 Dec 2016 13:48:12 +0000 (13:48 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 12 Dec 2016 13:48:12 +0000 (13:48 +0000)
src/libmime/content_type.c

index 9161850c9fb2b355b5c368f743bc5e49a1993d72..fa9768bf4768038b3650e2185a365a259c1f23a8 100644 (file)
@@ -50,6 +50,15 @@ rspamd_content_type_add_param (rspamd_mempool_t *pool,
        if (!found) {
                g_hash_table_insert (ct->attrs, &nparam->name, nparam);
        }
+
+       srch.begin = "charset";
+       srch.len = 7;
+
+       if (rspamd_ftok_cmp (&nparam->name, &srch) == 0) {
+               /* Adjust charset */
+               ct->charset.begin = nparam->value.begin;
+               ct->charset.len = nparam->value.len;
+       }
 }
 
 struct rspamd_content_type *