From 872247289f842303f7a989298423179715a6f1bb Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 13 Aug 2021 14:00:35 +0100 Subject: [PATCH] [Minor] Lua_magic: Fix xml detection --- lualib/lua_magic/heuristics.lua | 21 ++++++++++++--------- lualib/lua_magic/types.lua | 4 ++++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lualib/lua_magic/heuristics.lua b/lualib/lua_magic/heuristics.lua index d3469e2f9..2571346b4 100644 --- a/lualib/lua_magic/heuristics.lua +++ b/lualib/lua_magic/heuristics.lua @@ -63,15 +63,15 @@ local zip_patterns = { local txt_trie local txt_patterns = { html = { - {[[(?i)\s*]], 31}, + } } -- Used to match pattern index and extension diff --git a/lualib/lua_magic/types.lua b/lualib/lua_magic/types.lua index 9f64b12a2..f082a53e5 100644 --- a/lualib/lua_magic/types.lua +++ b/lualib/lua_magic/types.lua @@ -284,6 +284,10 @@ local types = { ct = 'image/vnd.dwg', }, -- Text + xml = { + ct = 'application/xml', + type = 'text', + }, txt = { type = 'text', ct = 'text/plain', -- 2.39.5