From 7a825752f52bba2df2e8d405c3fa77e419b82a59 Mon Sep 17 00:00:00 2001 From: okayurisotto Date: Mon, 3 Jul 2023 06:12:40 +0900 Subject: [PATCH] cleanup(`ApNoteService.ts`) --- .../src/core/activitypub/models/ApNoteService.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/backend/src/core/activitypub/models/ApNoteService.ts b/packages/backend/src/core/activitypub/models/ApNoteService.ts index 3c766a061a..ff3ced0adc 100644 --- a/packages/backend/src/core/activitypub/models/ApNoteService.ts +++ b/packages/backend/src/core/activitypub/models/ApNoteService.ts @@ -294,19 +294,18 @@ export class ApNoteService { const uri = typeof value === 'string' ? value : value.id; if (uri == null) throw new Error('missing uri'); - // ブロックしてたら中断 + // ブロックしていたら中断 const meta = await this.metaService.fetch(); - if (this.utilityService.isBlockedHost(meta.blockedHosts, this.utilityService.extractDbHost(uri))) throw new StatusError('blocked host', 451); + if (this.utilityService.isBlockedHost(meta.blockedHosts, this.utilityService.extractDbHost(uri))) { + throw new StatusError('blocked host', 451); + } const unlock = await this.appLockService.getApLock(uri); try { //#region このサーバーに既に登録されていたらそれを返す const exist = await this.fetchNote(uri); - - if (exist) { - return exist; - } + if (exist) return exist; //#endregion if (uri.startsWith(this.config.url)) {