summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-06-08 19:57:01 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-06-08 19:57:01 -0400
commit141a92cf0c4919b124f66b975dca83c64f0738f8 (patch)
tree7be6c9911bd16a26231aef4f304b9ce9b5764a88
parentmerge: Fix regressions and missing parts of recent work (!1102) (diff)
downloadsharkey-141a92cf0c4919b124f66b975dca83c64f0738f8.tar.gz
sharkey-141a92cf0c4919b124f66b975dca83c64f0738f8.tar.bz2
sharkey-141a92cf0c4919b124f66b975dca83c64f0738f8.zip
fix inverted condition in resolveLocal
-rw-r--r--packages/backend/src/core/activitypub/ApResolverService.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/backend/src/core/activitypub/ApResolverService.ts b/packages/backend/src/core/activitypub/ApResolverService.ts
index b4e7d6a7d7..9aa9787d6a 100644
--- a/packages/backend/src/core/activitypub/ApResolverService.ts
+++ b/packages/backend/src/core/activitypub/ApResolverService.ts
@@ -347,6 +347,7 @@ export class Resolver {
return object;
}
+ // TODO try to remove this, as it creates a large attack surface
@bindThis
private resolveLocal(url: string): Promise<IObjectWithId> {
const parsed = this.apDbResolverService.parseUri(url);
@@ -376,7 +377,7 @@ export class Resolver {
.then(([note, poll]) => this.apRendererService.renderQuestion({ id: note.userId }, note, poll)) as Promise<IObjectWithId>;
case 'likes':
return this.noteReactionsRepository.findOneOrFail({ where: { id: parsed.id }, relations: { user: true } }).then(async reaction => {
- if (reaction.user?.host == null) {
+ if (reaction.user?.host != null) {
throw new IdentifiableError('02b40cd0-fa92-4b0c-acc9-fb2ada952ab8', `failed to resolve local ${url}: not a local reaction`);
}
return this.apRendererService.addContext(await this.apRendererService.renderLike(reaction, { uri: null }));