From: Anton Yuzhaninov Date: Wed, 19 Aug 2020 16:39:59 +0000 (+0100) Subject: [Minor] Improve lua_magic HTML content type check X-Git-Tag: 2.6~137^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F3477%2Fhead;p=thirdparty%2Frspamd.git [Minor] Improve lua_magic HTML content type check Types which are used for html (xhtml) attachments: text/html application/html application/xhtml+xml Type which cannot be found in the wild: text/htm --- diff --git a/lualib/lua_magic/heuristics.lua b/lualib/lua_magic/heuristics.lua index 8c63cce72d..d36b5633fe 100644 --- a/lualib/lua_magic/heuristics.lua +++ b/lualib/lua_magic/heuristics.lua @@ -434,7 +434,7 @@ exports.text_part_heuristic = function(part, log_obj, _) end end - if mtype == 'text' and (msubtype == 'html' or msubtype == 'htm') then + if (mtype == 'text' or mtype == 'application') and (msubtype == 'html' or msubtype == 'xhtml+xml') then return 'html',21 end @@ -458,4 +458,4 @@ exports.pdf_format_heuristic = function(input, log_obj, pos, part) return 'pdf',weight end -return exports \ No newline at end of file +return exports