summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/UtilityService.ts
diff options
context:
space:
mode:
authorJulia <julia@insertdomain.name>2024-11-21 02:58:28 +0000
committerJulia <julia@insertdomain.name>2024-11-21 02:58:28 +0000
commit41536480ce78ccd36772fc6dcc57e36039becbbb (patch)
treee20b48508b5126cf0a11cf2343278ab9930b24e6 /packages/backend/src/core/UtilityService.ts
parentmerge: Fix linter error in emojis endpoint (!758) (diff)
parentBump develop version (diff)
downloadsharkey-41536480ce78ccd36772fc6dcc57e36039becbbb.tar.gz
sharkey-41536480ce78ccd36772fc6dcc57e36039becbbb.tar.bz2
sharkey-41536480ce78ccd36772fc6dcc57e36039becbbb.zip
merge: Bump develop version (!766)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/766
Diffstat (limited to 'packages/backend/src/core/UtilityService.ts')
-rw-r--r--packages/backend/src/core/UtilityService.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/backend/src/core/UtilityService.ts b/packages/backend/src/core/UtilityService.ts
index 009dd4665f..4c6d539e16 100644
--- a/packages/backend/src/core/UtilityService.ts
+++ b/packages/backend/src/core/UtilityService.ts
@@ -35,6 +35,11 @@ export class UtilityService {
}
@bindThis
+ public isUriLocal(uri: string): boolean {
+ return this.punyHost(uri) === this.toPuny(this.config.host);
+ }
+
+ @bindThis
public isBlockedHost(blockedHosts: string[], host: string | null): boolean {
if (host == null) return false;
return blockedHosts.some(x => `.${host.toLowerCase()}`.endsWith(`.${x}`));