diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-09 16:16:22 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-11 08:48:20 +0200 |
commit | 1d6e5dfc376f3c0c2120055cc093161e76419f98 (patch) | |
tree | b5333449166fdd0892704f8b9c1e976614857543 /server/lib/activitypub | |
parent | a077482fb7eece925c44cb31796b40e8e7b1f249 (diff) | |
download | PeerTube-1d6e5dfc376f3c0c2120055cc093161e76419f98.tar.gz PeerTube-1d6e5dfc376f3c0c2120055cc093161e76419f98.tar.zst PeerTube-1d6e5dfc376f3c0c2120055cc093161e76419f98.zip |
Improve video torrent AP object validator
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r-- | server/lib/activitypub/videos.ts | 4 |
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' | |||
5 | import { ActivityIconObject } from '../../../shared/index' | 5 | import { ActivityIconObject } from '../../../shared/index' |
6 | import { VideoTorrentObject } from '../../../shared/models/activitypub/objects' | 6 | import { VideoTorrentObject } from '../../../shared/models/activitypub/objects' |
7 | import { VideoPrivacy, VideoRateType } from '../../../shared/models/videos' | 7 | import { VideoPrivacy, VideoRateType } from '../../../shared/models/videos' |
8 | import { isVideoTorrentObjectValid } from '../../helpers/custom-validators/activitypub/videos' | 8 | import { sanitizeAndCheckVideoTorrentObject } from '../../helpers/custom-validators/activitypub/videos' |
9 | import { isVideoFileInfoHashValid } from '../../helpers/custom-validators/videos' | 9 | import { isVideoFileInfoHashValid } from '../../helpers/custom-validators/videos' |
10 | import { retryTransactionWrapper } from '../../helpers/database-utils' | 10 | import { retryTransactionWrapper } from '../../helpers/database-utils' |
11 | import { logger } from '../../helpers/logger' | 11 | import { 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 | } |