diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-14 10:57:56 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:51 +0100 |
commit | e34c85e527100c0b5c44567bd951e95be41b8d7e (patch) | |
tree | 39697c5a4dda2c2e07142a8522538db783fce2fd /server/helpers/custom-validators/activitypub/videos.ts | |
parent | 1e1265b36c09df1465aa2b4866815c957b6a532e (diff) | |
download | PeerTube-e34c85e527100c0b5c44567bd951e95be41b8d7e.tar.gz PeerTube-e34c85e527100c0b5c44567bd951e95be41b8d7e.tar.zst PeerTube-e34c85e527100c0b5c44567bd951e95be41b8d7e.zip |
Fix issues on server start
Diffstat (limited to 'server/helpers/custom-validators/activitypub/videos.ts')
-rw-r--r-- | server/helpers/custom-validators/activitypub/videos.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts index 9233a1359..8f6d50f50 100644 --- a/server/helpers/custom-validators/activitypub/videos.ts +++ b/server/helpers/custom-validators/activitypub/videos.ts | |||
@@ -10,7 +10,8 @@ import { | |||
10 | isVideoTruncatedDescriptionValid, | 10 | isVideoTruncatedDescriptionValid, |
11 | isVideoDurationValid, | 11 | isVideoDurationValid, |
12 | isVideoNameValid, | 12 | isVideoNameValid, |
13 | isVideoTagValid | 13 | isVideoTagValid, |
14 | isVideoUrlValid | ||
14 | } from '../videos' | 15 | } from '../videos' |
15 | import { isVideoChannelDescriptionValid, isVideoChannelNameValid } from '../video-channels' | 16 | import { isVideoChannelDescriptionValid, isVideoChannelNameValid } from '../video-channels' |
16 | import { isBaseActivityValid } from './misc' | 17 | import { isBaseActivityValid } from './misc' |
@@ -93,7 +94,7 @@ function isRemoteVideoContentValid (mediaType: string, content: string) { | |||
93 | 94 | ||
94 | function isRemoteVideoIconValid (icon: any) { | 95 | function isRemoteVideoIconValid (icon: any) { |
95 | return icon.type === 'Image' && | 96 | return icon.type === 'Image' && |
96 | validator.isURL(icon.url) && | 97 | isVideoUrlValid(icon.url) && |
97 | icon.mediaType === 'image/jpeg' && | 98 | icon.mediaType === 'image/jpeg' && |
98 | validator.isInt(icon.width, { min: 0 }) && | 99 | validator.isInt(icon.width, { min: 0 }) && |
99 | validator.isInt(icon.height, { min: 0 }) | 100 | validator.isInt(icon.height, { min: 0 }) |
@@ -111,7 +112,7 @@ function setValidRemoteVideoUrls (video: any) { | |||
111 | function isRemoteVideoUrlValid (url: any) { | 112 | function isRemoteVideoUrlValid (url: any) { |
112 | return url.type === 'Link' && | 113 | return url.type === 'Link' && |
113 | ACTIVITY_PUB.VIDEO_URL_MIME_TYPES.indexOf(url.mimeType) !== -1 && | 114 | ACTIVITY_PUB.VIDEO_URL_MIME_TYPES.indexOf(url.mimeType) !== -1 && |
114 | validator.isURL(url.url) && | 115 | isVideoUrlValid(url.url) && |
115 | validator.isInt(url.width, { min: 0 }) && | 116 | validator.isInt(url.width, { min: 0 }) && |
116 | validator.isInt(url.size, { min: 0 }) | 117 | validator.isInt(url.size, { min: 0 }) |
117 | } | 118 | } |