fix(backend): improve isFederationAllowedHost
This commit is contained in:
parent
23d2d191a0
commit
73bcd330f7
|
|
@ -133,6 +133,7 @@ export class UtilityService {
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public isFederationAllowedHost(host: string): boolean {
|
public isFederationAllowedHost(host: string): boolean {
|
||||||
|
if (this.isSelfHost(host)) return true;
|
||||||
if (this.meta.federation === 'none') return false;
|
if (this.meta.federation === 'none') return false;
|
||||||
if (this.meta.federation === 'specified' && !this.meta.federationHosts.some(x => `.${host.toLowerCase()}`.endsWith(`.${x}`))) return false;
|
if (this.meta.federation === 'specified' && !this.meta.federationHosts.some(x => `.${host.toLowerCase()}`.endsWith(`.${x}`))) return false;
|
||||||
if (this.isBlockedHost(this.meta.blockedHosts, host)) return false;
|
if (this.isBlockedHost(this.meta.blockedHosts, host)) return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue