diff options
author | Chocobozzz <me@florianbigard.com> | 2021-11-16 10:05:12 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-11-16 10:28:31 +0100 |
commit | a2f99b54dfdfe489e14714681189cb13c89f60a3 (patch) | |
tree | c8c06b8ebd9bd35e709882cf7cf535b11e53d481 /server/helpers/custom-validators/activitypub | |
parent | 11a554cfcf96dab55681001976a553ff8e3d9dcf (diff) | |
download | PeerTube-a2f99b54dfdfe489e14714681189cb13c89f60a3.tar.gz PeerTube-a2f99b54dfdfe489e14714681189cb13c89f60a3.tar.zst PeerTube-a2f99b54dfdfe489e14714681189cb13c89f60a3.zip |
Optimize AP fetch
Diffstat (limited to 'server/helpers/custom-validators/activitypub')
-rw-r--r-- | server/helpers/custom-validators/activitypub/actor.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/helpers/custom-validators/activitypub/actor.ts b/server/helpers/custom-validators/activitypub/actor.ts index 675a7b663..a4b152722 100644 --- a/server/helpers/custom-validators/activitypub/actor.ts +++ b/server/helpers/custom-validators/activitypub/actor.ts | |||
@@ -60,11 +60,12 @@ function isActorDeleteActivityValid (activity: any) { | |||
60 | } | 60 | } |
61 | 61 | ||
62 | function sanitizeAndCheckActorObject (actor: any) { | 62 | function sanitizeAndCheckActorObject (actor: any) { |
63 | if (!isActorTypeValid(actor.type)) return false | ||
64 | |||
63 | normalizeActor(actor) | 65 | normalizeActor(actor) |
64 | 66 | ||
65 | return exists(actor) && | 67 | return exists(actor) && |
66 | isActivityPubUrlValid(actor.id) && | 68 | isActivityPubUrlValid(actor.id) && |
67 | isActorTypeValid(actor.type) && | ||
68 | isActivityPubUrlValid(actor.inbox) && | 69 | isActivityPubUrlValid(actor.inbox) && |
69 | isActorPreferredUsernameValid(actor.preferredUsername) && | 70 | isActorPreferredUsernameValid(actor.preferredUsername) && |
70 | isActivityPubUrlValid(actor.url) && | 71 | isActivityPubUrlValid(actor.url) && |