summaryrefslogtreecommitdiff
path: root/packages/backend/src/core
diff options
context:
space:
mode:
author鴇峰 朔華 <160555157+sakuhanight@users.noreply.github.com>2025-02-26 10:28:53 +0900
committerGitHub <noreply@github.com>2025-02-26 01:28:53 +0000
commit39c487e1d18985e605ab9adae1b49cf63db4e753 (patch)
tree42580aca67d0c9aa763bfb09d0d0fa3bca9cbc1f /packages/backend/src/core
parentfix(backend): clips/updateのdescriptionで空文字を許容するように ... (diff)
downloadsharkey-39c487e1d18985e605ab9adae1b49cf63db4e753.tar.gz
sharkey-39c487e1d18985e605ab9adae1b49cf63db4e753.tar.bz2
sharkey-39c487e1d18985e605ab9adae1b49cf63db4e753.zip
fix(backend): ローカル判定でisUriLocalを使用していない箇所を修正 (#15069)
* fix(backend): ローカル判定でisUriLocalを使用していない箇所を修正 * fix(test backend): RelayServiceでUtilityServiceを使う
Diffstat (limited to 'packages/backend/src/core')
-rw-r--r--packages/backend/src/core/RemoteUserResolveService.ts2
-rw-r--r--packages/backend/src/core/activitypub/ApRendererService.ts4
2 files changed, 4 insertions, 2 deletions
diff --git a/packages/backend/src/core/RemoteUserResolveService.ts b/packages/backend/src/core/RemoteUserResolveService.ts
index 098b5e1706..a2f1b73cdb 100644
--- a/packages/backend/src/core/RemoteUserResolveService.ts
+++ b/packages/backend/src/core/RemoteUserResolveService.ts
@@ -74,7 +74,7 @@ export class RemoteUserResolveService {
if (user == null) {
const self = await this.resolveSelf(acctLower);
- if (self.href.startsWith(this.config.url)) {
+ if (this.utilityService.isUriLocal(self.href)) {
const local = this.apDbResolverService.parseUri(self.href);
if (local.local && local.type === 'users') {
// the LR points to local
diff --git a/packages/backend/src/core/activitypub/ApRendererService.ts b/packages/backend/src/core/activitypub/ApRendererService.ts
index 9148095067..8688015aff 100644
--- a/packages/backend/src/core/activitypub/ApRendererService.ts
+++ b/packages/backend/src/core/activitypub/ApRendererService.ts
@@ -27,6 +27,7 @@ import type { UsersRepository, UserProfilesRepository, NotesRepository, DriveFil
import { bindThis } from '@/decorators.js';
import { CustomEmojiService } from '@/core/CustomEmojiService.js';
import { IdService } from '@/core/IdService.js';
+import { UtilityService } from '@/core/UtilityService.js';
import { JsonLdService } from './JsonLdService.js';
import { ApMfmService } from './ApMfmService.js';
import { CONTEXT } from './misc/contexts.js';
@@ -61,6 +62,7 @@ export class ApRendererService {
private apMfmService: ApMfmService,
private mfmService: MfmService,
private idService: IdService,
+ private utilityService: UtilityService,
) {
}
@@ -577,7 +579,7 @@ export class ApRendererService {
@bindThis
public renderUndo(object: string | IObject, user: { id: MiUser['id'] }): IUndo {
- const id = typeof object !== 'string' && typeof object.id === 'string' && object.id.startsWith(this.config.url) ? `${object.id}/undo` : undefined;
+ const id = typeof object !== 'string' && typeof object.id === 'string' && this.utilityService.isUriLocal(object.id) ? `${object.id}/undo` : undefined;
return {
type: 'Undo',