From: Thomas Oettli Date: Tue, 16 Apr 2019 07:25:14 +0000 (+0200) Subject: [Minor] mime_types: use higher weighted MIME type X-Git-Tag: 1.9.2~9^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F2852%2Fhead;p=thirdparty%2Frspamd.git [Minor] mime_types: use higher weighted MIME type if detected MIME type differs from Content-Type header --- diff --git a/src/plugins/lua/mime_types.lua b/src/plugins/lua/mime_types.lua index 1141047a27..e621b56666 100644 --- a/src/plugins/lua/mime_types.lua +++ b/src/plugins/lua/mime_types.lua @@ -1086,13 +1086,12 @@ local function check_mime_type(task) end if map then - local v + local v = map:get_key(ct) local detected_different = false if detected_ct and detected_ct ~= ct then - v = map:get_key(detected_ct) + local v_detected = map:get_key(detected_ct) + if v_detected > v then v = v_detected end detected_different = true - else - v = map:get_key(ct) end if v then local n = tonumber(v)