fix image detection to not accept ANY mimetype

This commit is contained in:
murm 2023-03-16 20:39:10 -04:00
parent e67c0d96ca
commit 972e1a5bab

View file

@ -142,7 +142,10 @@ const checkImages = async (message, extraReturnTypes, video, sticker) => {
url = url.replace(/.*\n\n/g, "") url = url.replace(/.*\n\n/g, "")
if (isValidUrl(url)){ if (isValidUrl(url)){
const mimetype = await getType(url, extraReturnTypes) const mimetype = await getType(url, extraReturnTypes)
type = {name: "image", path: url, url: url, type: mimetype} // console.log(mimetype)
if (mimetype && imageFormats.includes(mimetype)) {
type = {name: "image", path: url, url: url, type: mimetype}
}
} }
} }