fix: skip when the mime-type cannot match due to file permissions

This commit is contained in:
sxyazi 2024-02-25 02:19:03 +08:00
parent 5e43f878c6
commit b8d8dbef4b
No known key found for this signature in database

View file

@ -1,9 +1,11 @@
local SUPPORTED_TYPES = "application/audio/biosig/chemical/font/image/inode/message/model/rinex/text/vector/video/x-epoc/"
local M = {}
local function match_mimetype(s)
local type, subtype = s:match("([-a-z]+/)([+-.a-zA-Z0-9]+)%s*$")
if string.find("application/audio/biosig/chemical/font/image/inode/message/model/rinex/text/vector/video/x-epoc/", type, 1, true) then
return type .. subtype
local type, sub = s:match("([-a-z]+/)([+-.a-zA-Z0-9]+)%s*$")
if type and sub and string.find(SUPPORTED_TYPES, type, 1, true) then
return type .. sub
end
end