From 5cf135001124cd19183336dbfcae1cd432217b00 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 11 May 2018 15:41:54 +0200 Subject: Improve AP validation for Notes --- server/lib/activitypub/video-comments.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/lib/activitypub') 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 @@ import { VideoCommentObject } from '../../../shared/models/activitypub/objects/video-comment-object' -import { isVideoCommentObjectValid } from '../../helpers/custom-validators/activitypub/video-comments' +import { sanitizeAndCheckVideoCommentObject } from '../../helpers/custom-validators/activitypub/video-comments' import { logger } from '../../helpers/logger' import { doRequest } from '../../helpers/requests' import { ACTIVITY_PUB } from '../../initializers' @@ -52,7 +52,7 @@ async function addVideoComment (videoInstance: VideoModel, commentUrl: string) { activityPub: true }) - if (isVideoCommentObjectValid(body) === false) { + if (sanitizeAndCheckVideoCommentObject(body) === false) { logger.debug('Remote video comment JSON is not valid.', { body }) return undefined } @@ -123,7 +123,7 @@ async function resolveThread (url: string, comments: VideoCommentModel[] = []) { activityPub: true }) - if (isVideoCommentObjectValid(body) === false) { + if (sanitizeAndCheckVideoCommentObject(body) === false) { throw new Error('Remote video comment JSON is not valid :' + JSON.stringify(body)) } -- cgit v1.2.3