aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Oettli <spacefreak@noop.ch>2019-04-16 09:25:14 +0200
committerThomas Oettli <spacefreak@noop.ch>2019-04-16 09:25:14 +0200
commit0165255b168b4a55056f533f9c761b36cceb29b6 (patch)
tree1394fa3e873d5f60975e0d85a7312405e1f715d8 /src
parent0e20e00c8d53433507f178098c17d152d754de78 (diff)
downloadrspamd-0165255b168b4a55056f533f9c761b36cceb29b6.tar.gz
rspamd-0165255b168b4a55056f533f9c761b36cceb29b6.zip
[Minor] mime_types: use higher weighted MIME type
if detected MIME type differs from Content-Type header
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/mime_types.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/plugins/lua/mime_types.lua b/src/plugins/lua/mime_types.lua
index 1141047a2..e621b5666 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)