Fix downloadImage not returning 2 when content-type isn't image
All checks were successful
CI / CI (push) Successful in 1m24s

This commit is contained in:
SileNce5k 2025-04-30 23:17:49 +02:00
parent f0e08eec13
commit ca646fc5ee
Signed by: SileNce
GPG key ID: B0A142BB4291B204

View file

@ -84,7 +84,7 @@ module.exports = {
async downloadImage(url, path) {
const res = await fetch(url);
if(!res.ok) return 1;
if(!res.headers.get('content-type').startsWith("image")) 2;
if(!res.headers.get('content-type').startsWith("image")) return 2;
const stream = Readable.fromWeb(res.body)
await writeFile(path, stream);
return 0;