mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 20:27:13 +02:00
fix: crash in resolveInboxes
2025-11-13T12:38:44.161Z [4568/2508892] - [31merror[39m: uncaughtException: Invalid URL
TypeError: Invalid URL
at new URL (node:internal/url:818:25)
at /home/saas/nodebb/src/activitypub/index.js:123:25
at Array.filter (<anonymous>)
at ActivityPub.resolveInboxes (/home/saas/nodebb/src/activitypub/index.js:122:13)
at ActivityPub.send (/home/saas/nodebb/src/activitypub/index.js:424:36)
at Object.announce (/home/saas/nodebb/src/activitypub/feps.js:72:20)
This commit is contained in:
@@ -119,8 +119,13 @@ ActivityPub.resolveInboxes = async (ids) => {
|
|||||||
|
|
||||||
if (!meta.config.activitypubAllowLoopback) {
|
if (!meta.config.activitypubAllowLoopback) {
|
||||||
ids = ids.filter((id) => {
|
ids = ids.filter((id) => {
|
||||||
const { hostname } = new URL(id);
|
try {
|
||||||
return hostname !== nconf.get('url_parsed').hostname;
|
const { hostname } = new URL(id);
|
||||||
|
return hostname !== nconf.get('url_parsed').hostname;
|
||||||
|
} catch (err) {
|
||||||
|
winston.error(`[activitypub/resolveInboxes] Invalid id: ${id}`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user