fix: sanity-check the id when mocking a post

This commit is contained in:
Julian Lam
2025-02-08 20:28:17 -05:00
parent 040584f035
commit 5cbf3dd7ea

View File

@@ -155,7 +155,10 @@ Mocks.post = async (objects) => {
await activitypub.actors.assert(Array.from(actorIds));
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;
}