summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/UtilityService.ts
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2026-03-02 16:05:12 -0500
committerFreya Murphy <freya@freyacat.org>2026-03-05 12:55:43 -0500
commit587ab8500abb2d8b0a494dc05952c9919cc7f66f (patch)
tree07f50e1153a029158baed106aa8367c9fa32cd7a /packages/backend/src/core/UtilityService.ts
parentMerge pull request #17217 from misskey-dev/develop (diff)
downloadmisskey-587ab8500abb2d8b0a494dc05952c9919cc7f66f.tar.gz
misskey-587ab8500abb2d8b0a494dc05952c9919cc7f66f.tar.bz2
misskey-587ab8500abb2d8b0a494dc05952c9919cc7f66f.zip
split url into webUrl and localUrl (like mastodon)
Diffstat (limited to 'packages/backend/src/core/UtilityService.ts')
-rw-r--r--packages/backend/src/core/UtilityService.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/backend/src/core/UtilityService.ts b/packages/backend/src/core/UtilityService.ts
index e3ceebccae..38390d0a2c 100644
--- a/packages/backend/src/core/UtilityService.ts
+++ b/packages/backend/src/core/UtilityService.ts
@@ -26,18 +26,20 @@ export class UtilityService {
@bindThis
public getFullApAccount(username: string, host: string | null): string {
- return host ? `${username}@${this.toPuny(host)}` : `${username}@${this.toPuny(this.config.host)}`;
+ return host ? `${username}@${this.toPuny(host)}` : `${username}@${this.toPuny(this.config.localHost)}`;
}
@bindThis
public isSelfHost(host: string | null): boolean {
if (host == null) return true;
- return this.toPuny(this.config.host) === this.toPuny(host);
+ return (this.toPuny(this.config.localHost) === this.toPuny(host)) ||
+ (this.toPuny(this.config.webHost) === this.toPuny(host))
}
@bindThis
public isUriLocal(uri: string): boolean {
- return this.punyHost(uri) === this.toPuny(this.config.host);
+ return (this.punyHost(uri) === this.toPuny(this.config.localHost)) ||
+ (this.punyHost(uri) === this.toPuny(this.config.webHost))
}
// メールアドレスのバリデーションを行う