aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/activitypub/videos.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-11 15:41:54 +0200
committerChocobozzz <me@florianbigard.com>2018-05-11 15:41:54 +0200
commit5cf135001124cd19183336dbfcae1cd432217b00 (patch)
tree2741f19ef66750a320c179dd8af435f6f768a98d /server/helpers/custom-validators/activitypub/videos.ts
parent0f320037e689b2778959c12ddd4ce790f6e4ae4f (diff)
downloadPeerTube-5cf135001124cd19183336dbfcae1cd432217b00.tar.gz
PeerTube-5cf135001124cd19183336dbfcae1cd432217b00.tar.zst
PeerTube-5cf135001124cd19183336dbfcae1cd432217b00.zip
Improve AP validation for Notes
Diffstat (limited to 'server/helpers/custom-validators/activitypub/videos.ts')
-rw-r--r--server/helpers/custom-validators/activitypub/videos.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts
index 0d2e8766d..7e1d57c34 100644
--- a/server/helpers/custom-validators/activitypub/videos.ts
+++ b/server/helpers/custom-validators/activitypub/videos.ts
@@ -43,13 +43,14 @@ function isActivityPubVideoDurationValid (value: string) {
43} 43}
44 44
45function sanitizeAndCheckVideoTorrentObject (video: any) { 45function sanitizeAndCheckVideoTorrentObject (video: any) {
46 if (video.type !== 'Video') return false
47
46 if (!setValidRemoteTags(video)) return false 48 if (!setValidRemoteTags(video)) return false
47 if (!setValidRemoteVideoUrls(video)) return false 49 if (!setValidRemoteVideoUrls(video)) return false
48 if (!setRemoteVideoTruncatedContent(video)) return false 50 if (!setRemoteVideoTruncatedContent(video)) return false
49 if (!setValidAttributedTo(video)) return false 51 if (!setValidAttributedTo(video)) return false
50 52
51 return video.type === 'Video' && 53 return isActivityPubUrlValid(video.id) &&
52 isActivityPubUrlValid(video.id) &&
53 isVideoNameValid(video.name) && 54 isVideoNameValid(video.name) &&
54 isActivityPubVideoDurationValid(video.duration) && 55 isActivityPubVideoDurationValid(video.duration) &&
55 isUUIDValid(video.uuid) && 56 isUUIDValid(video.uuid) &&