aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
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/lib
parent0f320037e689b2778959c12ddd4ce790f6e4ae4f (diff)
downloadPeerTube-5cf135001124cd19183336dbfcae1cd432217b00.tar.gz
PeerTube-5cf135001124cd19183336dbfcae1cd432217b00.tar.zst
PeerTube-5cf135001124cd19183336dbfcae1cd432217b00.zip
Improve AP validation for Notes
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/activitypub/video-comments.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/activitypub/video-comments.ts b/server/lib/activitypub/video-comments.ts
index 8ab0cdba4..60c9179a6 100644
--- a/server/lib/activitypub/video-comments.ts
+++ b/server/lib/activitypub/video-comments.ts
@@ -1,5 +1,5 @@
1import { VideoCommentObject } from '../../../shared/models/activitypub/objects/video-comment-object' 1import { VideoCommentObject } from '../../../shared/models/activitypub/objects/video-comment-object'
2import { isVideoCommentObjectValid } from '../../helpers/custom-validators/activitypub/video-comments' 2import { sanitizeAndCheckVideoCommentObject } from '../../helpers/custom-validators/activitypub/video-comments'
3import { logger } from '../../helpers/logger' 3import { logger } from '../../helpers/logger'
4import { doRequest } from '../../helpers/requests' 4import { doRequest } from '../../helpers/requests'
5import { ACTIVITY_PUB } from '../../initializers' 5import { ACTIVITY_PUB } from '../../initializers'
@@ -52,7 +52,7 @@ async function addVideoComment (videoInstance: VideoModel, commentUrl: string) {
52 activityPub: true 52 activityPub: true
53 }) 53 })
54 54
55 if (isVideoCommentObjectValid(body) === false) { 55 if (sanitizeAndCheckVideoCommentObject(body) === false) {
56 logger.debug('Remote video comment JSON is not valid.', { body }) 56 logger.debug('Remote video comment JSON is not valid.', { body })
57 return undefined 57 return undefined
58 } 58 }
@@ -123,7 +123,7 @@ async function resolveThread (url: string, comments: VideoCommentModel[] = []) {
123 activityPub: true 123 activityPub: true
124 }) 124 })
125 125
126 if (isVideoCommentObjectValid(body) === false) { 126 if (sanitizeAndCheckVideoCommentObject(body) === false) {
127 throw new Error('Remote video comment JSON is not valid :' + JSON.stringify(body)) 127 throw new Error('Remote video comment JSON is not valid :' + JSON.stringify(body))
128 } 128 }
129 129