aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-09 16:16:22 +0200
committerChocobozzz <me@florianbigard.com>2018-05-11 08:48:20 +0200
commit1d6e5dfc376f3c0c2120055cc093161e76419f98 (patch)
treeb5333449166fdd0892704f8b9c1e976614857543 /server/lib
parenta077482fb7eece925c44cb31796b40e8e7b1f249 (diff)
downloadPeerTube-1d6e5dfc376f3c0c2120055cc093161e76419f98.tar.gz
PeerTube-1d6e5dfc376f3c0c2120055cc093161e76419f98.tar.zst
PeerTube-1d6e5dfc376f3c0c2120055cc093161e76419f98.zip
Improve video torrent AP object validator
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/activitypub/videos.ts4
1 files changed, 2 insertions, 2 deletions
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'
5import { ActivityIconObject } from '../../../shared/index' 5import { ActivityIconObject } from '../../../shared/index'
6import { VideoTorrentObject } from '../../../shared/models/activitypub/objects' 6import { VideoTorrentObject } from '../../../shared/models/activitypub/objects'
7import { VideoPrivacy, VideoRateType } from '../../../shared/models/videos' 7import { VideoPrivacy, VideoRateType } from '../../../shared/models/videos'
8import { isVideoTorrentObjectValid } from '../../helpers/custom-validators/activitypub/videos' 8import { sanitizeAndCheckVideoTorrentObject } from '../../helpers/custom-validators/activitypub/videos'
9import { isVideoFileInfoHashValid } from '../../helpers/custom-validators/videos' 9import { isVideoFileInfoHashValid } from '../../helpers/custom-validators/videos'
10import { retryTransactionWrapper } from '../../helpers/database-utils' 10import { retryTransactionWrapper } from '../../helpers/database-utils'
11import { logger } from '../../helpers/logger' 11import { logger } from '../../helpers/logger'
@@ -317,7 +317,7 @@ async function fetchRemoteVideo (videoUrl: string): Promise<VideoTorrentObject>
317 317
318 const { body } = await doRequest(options) 318 const { body } = await doRequest(options)
319 319
320 if (isVideoTorrentObjectValid(body) === false) { 320 if (sanitizeAndCheckVideoTorrentObject(body) === false) {
321 logger.debug('Remote video JSON is not valid.', { body }) 321 logger.debug('Remote video JSON is not valid.', { body })
322 return undefined 322 return undefined
323 } 323 }