diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-12 15:35:30 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-12 15:35:30 +0100 |
commit | 9fb3abfdac5c4bffe9992a457e5210d3aa743952 (patch) | |
tree | b2feaec75e890ea842dcb52b9760863cd64481fb /server/helpers/custom-validators | |
parent | bd377530836474fa2a4404bd3e8bdd15f1b9ccc0 (diff) | |
download | PeerTube-9fb3abfdac5c4bffe9992a457e5210d3aa743952.tar.gz PeerTube-9fb3abfdac5c4bffe9992a457e5210d3aa743952.tar.zst PeerTube-9fb3abfdac5c4bffe9992a457e5210d3aa743952.zip |
Fix communication with mastodon
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r-- | server/helpers/custom-validators/activitypub/videos.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts index fb1d2d094..5d2a1f171 100644 --- a/server/helpers/custom-validators/activitypub/videos.ts +++ b/server/helpers/custom-validators/activitypub/videos.ts | |||
@@ -115,18 +115,18 @@ function isRemoteVideoUrlValid (url: any) { | |||
115 | return url.type === 'Link' && | 115 | return url.type === 'Link' && |
116 | ( | 116 | ( |
117 | ACTIVITY_PUB.URL_MIME_TYPES.VIDEO.indexOf(url.mimeType) !== -1 && | 117 | ACTIVITY_PUB.URL_MIME_TYPES.VIDEO.indexOf(url.mimeType) !== -1 && |
118 | isActivityPubUrlValid(url.url) && | 118 | isActivityPubUrlValid(url.href) && |
119 | validator.isInt(url.width + '', { min: 0 }) && | 119 | validator.isInt(url.width + '', { min: 0 }) && |
120 | validator.isInt(url.size + '', { min: 0 }) | 120 | validator.isInt(url.size + '', { min: 0 }) |
121 | ) || | 121 | ) || |
122 | ( | 122 | ( |
123 | ACTIVITY_PUB.URL_MIME_TYPES.TORRENT.indexOf(url.mimeType) !== -1 && | 123 | ACTIVITY_PUB.URL_MIME_TYPES.TORRENT.indexOf(url.mimeType) !== -1 && |
124 | isActivityPubUrlValid(url.url) && | 124 | isActivityPubUrlValid(url.href) && |
125 | validator.isInt(url.width + '', { min: 0 }) | 125 | validator.isInt(url.width + '', { min: 0 }) |
126 | ) || | 126 | ) || |
127 | ( | 127 | ( |
128 | ACTIVITY_PUB.URL_MIME_TYPES.MAGNET.indexOf(url.mimeType) !== -1 && | 128 | ACTIVITY_PUB.URL_MIME_TYPES.MAGNET.indexOf(url.mimeType) !== -1 && |
129 | validator.isLength(url.url, { min: 5 }) && | 129 | validator.isLength(url.href, { min: 5 }) && |
130 | validator.isInt(url.width + '', { min: 0 }) | 130 | validator.isInt(url.width + '', { min: 0 }) |
131 | ) | 131 | ) |
132 | } | 132 | } |