fix image detection to not accept ANY mimetype
This commit is contained in:
parent
e67c0d96ca
commit
972e1a5bab
1 changed files with 4 additions and 1 deletions
|
@ -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}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue