diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2019-04-11 03:09:12 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-04-11 03:09:12 +0900 |
| commit | 2a7e3b9c514e9cbb3e15551fba0d01280ebdc2e7 (patch) | |
| tree | 2af6308132f5fb852ebe1ff0e20df89463b15a7a /src/remote | |
| parent | Update CHANGELOG.md (diff) | |
| download | sharkey-2a7e3b9c514e9cbb3e15551fba0d01280ebdc2e7.tar.gz sharkey-2a7e3b9c514e9cbb3e15551fba0d01280ebdc2e7.tar.bz2 sharkey-2a7e3b9c514e9cbb3e15551fba0d01280ebdc2e7.zip | |
Fix: AP actor Service のサポートが不完全 (v11) (#4662)
Diffstat (limited to 'src/remote')
| -rw-r--r-- | src/remote/activitypub/models/person.ts | 3 | ||||
| -rw-r--r-- | src/remote/activitypub/type.ts | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/remote/activitypub/models/person.ts b/src/remote/activitypub/models/person.ts index e13ef21ebd..b2edf39734 100644 --- a/src/remote/activitypub/models/person.ts +++ b/src/remote/activitypub/models/person.ts @@ -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}'`); } diff --git a/src/remote/activitypub/type.ts b/src/remote/activitypub/type.ts index c381e63507..7e81a7cc4c 100644 --- a/src/remote/activitypub/type.ts +++ b/src/remote/activitypub/type.ts @@ -65,6 +65,8 @@ interface IQuestionChoice { _misskey_votes?: number; } +export const validActor = ['Person', 'Service']; + export interface IPerson extends IObject { type: 'Person'; name: string; |