mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 04:25:55 +01:00
refactor: resolveId method, add hostname verification
This commit is contained in:
@@ -93,10 +93,12 @@ inbox.announce = async (req) => {
|
||||
tid = await posts.getPostField(id, 'tid');
|
||||
} else {
|
||||
pid = object;
|
||||
([pid, tid] = await Promise.all([
|
||||
activitypub.notes.resolveId(0, pid),
|
||||
activitypub.notes.assertTopic(0, pid),
|
||||
]));
|
||||
pid = await activitypub.resolveId(0, pid); // in case wrong id is passed-in; unlikely, but still.
|
||||
if (!pid) {
|
||||
return;
|
||||
}
|
||||
|
||||
tid = await activitypub.notes.assertTopic(0, pid);
|
||||
if (!tid) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user