mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-05 07:10:30 +01:00
fix: handle cases where url passed to mime does not pass because url contained a query string
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user