From 972e1a5babe8351a8e697c89cc8c8cec68f1a671 Mon Sep 17 00:00:00 2001 From: murm Date: Thu, 16 Mar 2023 20:39:10 -0400 Subject: [PATCH] fix image detection to not accept ANY mimetype --- utils/imagedetect.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/imagedetect.js b/utils/imagedetect.js index 859464d..99dadf0 100644 --- a/utils/imagedetect.js +++ b/utils/imagedetect.js @@ -142,7 +142,10 @@ const checkImages = async (message, extraReturnTypes, video, sticker) => { url = url.replace(/.*\n\n/g, "") if (isValidUrl(url)){ 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} + } } }