From 39be9db453245cf561148e3f0e17c58dec2ce747 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 21 Sep 2019 13:47:55 +0100 Subject: [Minor] Fix tests and jpeg case --- lualib/lua_magic/heuristics.lua | 8 ++++---- lualib/lua_magic/types.lua | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'lualib/lua_magic') diff --git a/lualib/lua_magic/heuristics.lua b/lualib/lua_magic/heuristics.lua index d8c134e57..04c89ba69 100644 --- a/lualib/lua_magic/heuristics.lua +++ b/lualib/lua_magic/heuristics.lua @@ -74,9 +74,6 @@ local txt_patterns = { csv = { [[(?:[-a-zA-Z0-9_]+\s*,){2,}(?:[-a-zA-Z0-9_]+[\r\n])]] }, - js = { - [[\s*function\s*\(]], - }, } -- Used to match pattern index and extension @@ -303,7 +300,10 @@ exports.mime_part_heuristic = function(part, log_obj) if part:is_image() then local img = part:get_image() - return img:get_type():lower(),60 + local img_type = img:get_type():lower() + + if img_type == 'jpeg' then img_type = 'jpg' end + return img_type,60 end if part:is_archive() then diff --git a/lualib/lua_magic/types.lua b/lualib/lua_magic/types.lua index 93bfa6641..32c7cd131 100644 --- a/lualib/lua_magic/types.lua +++ b/lualib/lua_magic/types.lua @@ -258,10 +258,6 @@ local types = { type = 'message', ct = 'message/rfc822', }, - js = { - type = 'application', - ct = 'application/javascript', - }, } return types \ No newline at end of file -- cgit v1.2.3