Fix type error in security fixes
This commit is contained in:
parent
4b556efdaa
commit
fa3cf6c299
|
@ -163,13 +163,16 @@ export class ApPersonService implements OnModuleInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const collection of ['outbox', 'followers', 'following'] as (keyof IActor)[]) {
|
for (const collection of ['outbox', 'followers', 'following'] as (keyof IActor)[]) {
|
||||||
const collectionUri = getApId((x as IActor)[collection]);
|
const xCollection = (x as IActor)[collection];
|
||||||
if (typeof collectionUri === 'string' && collectionUri.length > 0) {
|
if (xCollection != null) {
|
||||||
if (this.utilityService.punyHost(collectionUri) !== expectHost) {
|
const collectionUri = getApId(xCollection);
|
||||||
throw new Error(`invalid Actor: ${collection} has different host`);
|
if (typeof collectionUri === 'string' && collectionUri.length > 0) {
|
||||||
|
if (this.utilityService.punyHost(collectionUri) !== expectHost) {
|
||||||
|
throw new Error(`invalid Actor: ${collection} has different host`);
|
||||||
|
}
|
||||||
|
} else if (collectionUri != null) {
|
||||||
|
throw new Error(`invalid Actor: wrong ${collection}`);
|
||||||
}
|
}
|
||||||
} else if (collectionUri != null) {
|
|
||||||
throw new Error(`invalid Actor: wrong ${collection}`);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue