summaryrefslogtreecommitdiff
path: root/packages/backend/src
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-05-26 11:34:46 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-05-26 11:34:46 -0400
commit1ab5ceb65aab5170a556e1880ea07b6eccc5d710 (patch)
tree4d09e9aaea0062734d2232dbeebedd06a31c9b53 /packages/backend/src
parentallow anonymous objects in secureResolve (diff)
downloadsharkey-1ab5ceb65aab5170a556e1880ea07b6eccc5d710.tar.gz
sharkey-1ab5ceb65aab5170a556e1880ea07b6eccc5d710.tar.bz2
sharkey-1ab5ceb65aab5170a556e1880ea07b6eccc5d710.zip
fix ID checks in resolveCollectionItems
Diffstat (limited to 'packages/backend/src')
-rw-r--r--packages/backend/src/core/activitypub/ApResolverService.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/backend/src/core/activitypub/ApResolverService.ts b/packages/backend/src/core/activitypub/ApResolverService.ts
index 1b4fed4461..6b95d9c93b 100644
--- a/packages/backend/src/core/activitypub/ApResolverService.ts
+++ b/packages/backend/src/core/activitypub/ApResolverService.ts
@@ -93,12 +93,12 @@ export class Resolver {
const items: IObjectWithId[] = [];
const collectionObj = await this.resolveCollection(collection);
- await this.resolveCollectionItemsTo(collectionObj, limit ?? undefined, allowAnonymousItems, collectionObj.id, items);
+ await this.resolveCollectionItemsTo(collectionObj, limit ?? undefined, allowAnonymousItems, items);
return items;
}
- private async resolveCollectionItemsTo(current: AnyCollection | null, limit: number | undefined, allowAnonymousItems: boolean | undefined, sourceUri: string | undefined, destination: IObjectWithId[]): Promise<void> {
+ private async resolveCollectionItemsTo(current: AnyCollection | null, limit: number | undefined, allowAnonymousItems: boolean | undefined, destination: IObjectWithId[]): Promise<void> {
// This is pulled up to avoid code duplication below
const iterate = async(items: ApObject): Promise<void> => {
for (const item of toArray(items)) {
@@ -109,8 +109,8 @@ export class Resolver {
if (limit != null && limit < 1) break;
// Use secureResolve whenever possible, to avoid re-fetching items that were included inline.
- const resolved = (sourceUri && !allowAnonymousItems)
- ? await this.secureResolve(item, sourceUri)
+ const resolved = current?.id
+ ? await this.secureResolve(item, current.id, allowAnonymousItems)
: await this.resolve(getApId(item), allowAnonymousItems);
destination.push(resolved);