Przeglądaj źródła

[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
tags/2.6
Anton Yuzhaninov 3 lat temu
rodzic
commit
d8c76f9fcb
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2
    2
      lualib/lua_magic/heuristics.lua

+ 2
- 2
lualib/lua_magic/heuristics.lua Wyświetl plik

@@ -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
return exports

Ładowanie…
Anuluj
Zapisz