fedimbed: dont error on weird attachment structures

This commit is contained in:
Cynthia Foxwell 2024-04-02 21:49:06 -06:00
parent 12f410a1cb
commit 70e7fdee04

View file

@ -508,7 +508,7 @@ async function processUrl(msg, url, spoiler = false) {
type: attachment.mediaType,
});
}
} else {
} else if (attachment.url) {
const contentType = await fetch(attachment.url, {
method: "HEAD",
}).then((res) => res.headers.get("Content-Type"));
@ -572,6 +572,10 @@ async function processUrl(msg, url, spoiler = false) {
});
}
}
} else {
logger.warn(
`Unhandled attachment structure! ${JSON.stringify(attachment)}`
);
}
}