mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: sanity-check the id when mocking a post
This commit is contained in:
@@ -155,7 +155,10 @@ Mocks.post = async (objects) => {
|
|||||||
await activitypub.actors.assert(Array.from(actorIds));
|
await activitypub.actors.assert(Array.from(actorIds));
|
||||||
|
|
||||||
const posts = await Promise.all(objects.map(async (object) => {
|
const posts = await Promise.all(objects.map(async (object) => {
|
||||||
if (!activitypub._constants.acceptedPostTypes.includes(object.type)) {
|
if (
|
||||||
|
!activitypub._constants.acceptedPostTypes.includes(object.type) ||
|
||||||
|
!activitypub.helpers.isUri(object.id) // sanity-check the id
|
||||||
|
) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user