Fix: AP actor Service のサポートが不完全 (v11) (#4662)
This commit is contained in:
parent
ab302df0ae
commit
2a7e3b9c51
4 changed files with 8 additions and 3 deletions
|
@ -24,6 +24,7 @@ import { UserPublickey } from '../../../models/entities/user-publickey';
|
|||
import { isDuplicateKeyValueError } from '../../../misc/is-duplicate-key-value-error';
|
||||
import { toPuny } from '../../../misc/convert-host';
|
||||
import { UserProfile } from '../../../models/entities/user-profile';
|
||||
import { validActor } from '../../../remote/activitypub/type';
|
||||
const logger = apLogger;
|
||||
|
||||
/**
|
||||
|
@ -38,7 +39,7 @@ function validatePerson(x: any, uri: string) {
|
|||
return new Error('invalid person: object is null');
|
||||
}
|
||||
|
||||
if (x.type != 'Person' && x.type != 'Service') {
|
||||
if (!validActor.includes(x.type)) {
|
||||
return new Error(`invalid person: object is not a person or service '${x.type}'`);
|
||||
}
|
||||
|
||||
|
|
|
@ -65,6 +65,8 @@ interface IQuestionChoice {
|
|||
_misskey_votes?: number;
|
||||
}
|
||||
|
||||
export const validActor = ['Person', 'Service'];
|
||||
|
||||
export interface IPerson extends IObject {
|
||||
type: 'Person';
|
||||
name: string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue