fix: handle cases where url passed to mime does not pass because url contained a query string

This commit is contained in:
Julian Lam
2025-02-06 17:58:54 -05:00
parent c3f8222f47
commit 5baa46d0bc

View File

@@ -201,6 +201,13 @@ Mocks.post = async (objects) => {
image = null;
}
}
if (image) {
const parsed = new URL(image);
if (!mime.getType(parsed.pathname).startsWith('image/')) {
activitypub.helpers.log(`[activitypub/mocks.post] Received image not identified as image due to MIME type: ${image}`);
image = null;
}
}
const payload = {
uid,