aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_magic/heuristics.lua
diff options
context:
space:
mode:
authorAnton Yuzhaninov <citrin+git@citrin.ru>2020-08-19 17:39:59 +0100
committerAnton Yuzhaninov <citrin+git@citrin.ru>2020-08-20 10:05:51 +0100
commitd8c76f9fcb23fc62db8fc539db4736dfaedb11f8 (patch)
tree430b87636998f21b7bf8af4849ae25779fec4435 /lualib/lua_magic/heuristics.lua
parent2549b7686d660e35ad46c0eb4acf736272f862a1 (diff)
downloadrspamd-d8c76f9fcb23fc62db8fc539db4736dfaedb11f8.tar.gz
rspamd-d8c76f9fcb23fc62db8fc539db4736dfaedb11f8.zip
[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
Diffstat (limited to 'lualib/lua_magic/heuristics.lua')
-rw-r--r--lualib/lua_magic/heuristics.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/lualib/lua_magic/heuristics.lua b/lualib/lua_magic/heuristics.lua
index 8c63cce72..d36b5633f 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