summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/UtilityService.ts
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2024-12-15 17:27:12 +0000
committerdakkar <dakkar@thenautilus.net>2024-12-15 17:27:12 +0000
commite2352839e4639b09e2e52b2ada1399097fad1d8d (patch)
tree9268cda477b8c1dcfb2c78eaabcb173a1566a469 /packages/backend/src/core/UtilityService.ts
parentmerge: Fix rate limits under multi-node environments (!809) (diff)
parentupstream merge checklist: remember to check federated profile fields (diff)
downloadsharkey-e2352839e4639b09e2e52b2ada1399097fad1d8d.tar.gz
sharkey-e2352839e4639b09e2e52b2ada1399097fad1d8d.tar.bz2
sharkey-e2352839e4639b09e2e52b2ada1399097fad1d8d.zip
merge: upstream changes for 2024.11 (!742)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/742 Closes #645 and #646 Approved-by: Hazelnoot <acomputerdog@gmail.com> Approved-by: Marie <github@yuugi.dev>
Diffstat (limited to 'packages/backend/src/core/UtilityService.ts')
-rw-r--r--packages/backend/src/core/UtilityService.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/packages/backend/src/core/UtilityService.ts b/packages/backend/src/core/UtilityService.ts
index dda4bd5fbd..f905914022 100644
--- a/packages/backend/src/core/UtilityService.ts
+++ b/packages/backend/src/core/UtilityService.ts
@@ -123,6 +123,7 @@ export class UtilityService {
return host;
}
+ @bindThis
private specialSuffix(hostname: string): string | null {
// masto.host provides domain names for its clients, we have to
// treat it as if it were a public suffix
@@ -143,6 +144,7 @@ export class UtilityService {
return host;
}
+ @bindThis
public isFederationAllowedHost(host: string): boolean {
if (this.meta.federation === 'none') return false;
if (this.meta.federation === 'specified' && !this.meta.federationHosts.some(x => `.${host.toLowerCase()}`.endsWith(`.${x}`))) return false;