aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-11-16 10:05:12 +0100
committerChocobozzz <me@florianbigard.com>2021-11-16 10:28:31 +0100
commita2f99b54dfdfe489e14714681189cb13c89f60a3 (patch)
treec8c06b8ebd9bd35e709882cf7cf535b11e53d481 /server/helpers/custom-validators
parent11a554cfcf96dab55681001976a553ff8e3d9dcf (diff)
downloadPeerTube-a2f99b54dfdfe489e14714681189cb13c89f60a3.tar.gz
PeerTube-a2f99b54dfdfe489e14714681189cb13c89f60a3.tar.zst
PeerTube-a2f99b54dfdfe489e14714681189cb13c89f60a3.zip
Optimize AP fetch
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r--server/helpers/custom-validators/activitypub/actor.ts3
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
62function sanitizeAndCheckActorObject (actor: any) { 62function 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) &&