From 149d5d9ba3fed43562b16911cadf78c53201c0a7 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 20 Nov 2020 11:23:28 +0000 Subject: [PATCH] [Minor] Lua_content: Allow multiple content types to be matched --- lualib/lua_content/init.lua | 13 ++++++++++--- 1 file 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 -- 2.39.5