fix: guard against missing to/cc

This commit is contained in:
Julian Lam
2024-10-17 11:19:22 -04:00
parent 873d033baf
commit 1d5f490de0

View File

@@ -78,7 +78,7 @@ inbox.create = async (req) => {
inbox.update = async (req) => {
const { actor, object } = req.body;
const isPublic = [...object.to, ...object.cc].includes(activitypub._constants.publicAddress);
const isPublic = [...(object.to || []), ...(object.cc || [])].includes(activitypub._constants.publicAddress);
// Origin checking
const actorHostname = new URL(actor).hostname;