diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-03-07 19:56:03 -0500 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-03-07 19:56:03 -0500 |
commit | 7677fcfec0c89f0068e795f333d6f0de9103f275 (patch) | |
tree | b79cb86ae74452618a4a7e82c843ec9925ae96a2 /lualib | |
parent | b7467f9d294faf54f25d2b2fc32255f613097416 (diff) | |
download | rspamd-7677fcfec0c89f0068e795f333d6f0de9103f275.tar.gz rspamd-7677fcfec0c89f0068e795f333d6f0de9103f275.zip |
[Minor] Fix plain Lua compatibility
Diffstat (limited to 'lualib')
-rw-r--r-- | lualib/lua_fuzzy.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lualib/lua_fuzzy.lua b/lualib/lua_fuzzy.lua index 683c57372..8547a5dbc 100644 --- a/lualib/lua_fuzzy.lua +++ b/lualib/lua_fuzzy.lua @@ -245,8 +245,15 @@ local function mime_types_check(task, part, rule) if not t then return false, false end local ct = string.format('%s/%s', t, st) + + local detected_ct t,st = part:get_detected_type() - local detected_ct = string.format('%s/%s', t, st) + if t then + detected_ct = string.format('%s/%s', t, st) + else + detected_ct = ct + end + local id = part:get_id() lua_util.debugm(N, task, 'check binary part %s: %s', id, ct) |