fix: skip when the mime-type cannot match due to file permissions (#725)

This commit is contained in:
三咲雅 · Misaki Masa 2024-02-25 02:56:40 +08:00 committed by GitHub
parent 5e43f878c6
commit b4d91df767
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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