summaryrefslogtreecommitdiffstats
path: root/lualib/lua_content/init.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-11-20 11:23:28 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-11-20 11:24:17 +0000
commit149d5d9ba3fed43562b16911cadf78c53201c0a7 (patch)
treedfdb19710e100db89b580d6d592a0b1594fb4e86 /lualib/lua_content/init.lua
parentf22fd35fc8650db2db4a75400184130ec2beae49 (diff)
downloadrspamd-149d5d9ba3fed43562b16911cadf78c53201c0a7.tar.gz
rspamd-149d5d9ba3fed43562b16911cadf78c53201c0a7.zip
[Minor] Lua_content: Allow multiple content types to be matched
Diffstat (limited to 'lualib/lua_content/init.lua')
-rw-r--r--lualib/lua_content/init.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/lualib/lua_content/init.lua b/lualib/lua_content/init.lua
index c23ca9d09..7bf42b9a1 100644
--- a/lualib/lua_content/init.lua
+++ b/lualib/lua_content/init.lua
@@ -26,9 +26,9 @@ local lua_util = require "lua_util"
local content_modules = {
ical = {
- mime_type = "text/calendar",
+ mime_type = {"text/calendar", "application/calendar"},
module = require "lua_content/ical",
- extensions = {'ical'},
+ extensions = {'ics'},
output = "text"
},
pdf = {
@@ -47,7 +47,14 @@ local function init()
modules_by_extension = {}
for k,v in pairs(content_modules) do
if v.mime_type then
- modules_by_mime_type[v.mime_type] = {k, v}
+ if type(v.mime_type) == 'table' then
+ for _,mt in ipairs(v.mime_type) do
+ modules_by_mime_type[mt] = {k, v}
+ end
+ else
+ modules_by_mime_type[v.mime_type] = {k, v}
+ end
+
end
if v.extensions then
for _,ext in ipairs(v.extensions) do