From 1d6e5dfc376f3c0c2120055cc093161e76419f98 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 9 May 2018 16:16:22 +0200 Subject: Improve video torrent AP object validator --- server/lib/activitypub/videos.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/lib') diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts index 7cb1fe240..b81acbb35 100644 --- a/server/lib/activitypub/videos.ts +++ b/server/lib/activitypub/videos.ts @@ -5,7 +5,7 @@ import * as request from 'request' import { ActivityIconObject } from '../../../shared/index' import { VideoTorrentObject } from '../../../shared/models/activitypub/objects' import { VideoPrivacy, VideoRateType } from '../../../shared/models/videos' -import { isVideoTorrentObjectValid } from '../../helpers/custom-validators/activitypub/videos' +import { sanitizeAndCheckVideoTorrentObject } from '../../helpers/custom-validators/activitypub/videos' import { isVideoFileInfoHashValid } from '../../helpers/custom-validators/videos' import { retryTransactionWrapper } from '../../helpers/database-utils' import { logger } from '../../helpers/logger' @@ -317,7 +317,7 @@ async function fetchRemoteVideo (videoUrl: string): Promise const { body } = await doRequest(options) - if (isVideoTorrentObjectValid(body) === false) { + if (sanitizeAndCheckVideoTorrentObject(body) === false) { logger.debug('Remote video JSON is not valid.', { body }) return undefined } -- cgit v1.2.3