diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-29 15:05:03 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-29 15:05:14 +0200 |
commit | f6a7c82ca51896a433bc2264c52afd6981c7c4c6 (patch) | |
tree | 61523331ce489fb89ea6f18da98088e255ea310b | |
parent | f6d2158fd9b16e304532549cf97440c0d995340b (diff) | |
download | PeerTube-f6a7c82ca51896a433bc2264c52afd6981c7c4c6.tar.gz PeerTube-f6a7c82ca51896a433bc2264c52afd6981c7c4c6.tar.zst PeerTube-f6a7c82ca51896a433bc2264c52afd6981c7c4c6.zip |
Fix AP activity validator
-rw-r--r-- | client/webpack/webpack.video-embed.js | 2 | ||||
-rw-r--r-- | server/helpers/custom-validators/activitypub/activity.ts | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/client/webpack/webpack.video-embed.js b/client/webpack/webpack.video-embed.js index 4a8879031..5a4e35dea 100644 --- a/client/webpack/webpack.video-embed.js +++ b/client/webpack/webpack.video-embed.js | |||
@@ -35,6 +35,8 @@ module.exports = function () { | |||
35 | publicPath: '/client/standalone/videos/' | 35 | publicPath: '/client/standalone/videos/' |
36 | }, | 36 | }, |
37 | 37 | ||
38 | // devtool: 'source-map', | ||
39 | |||
38 | module: { | 40 | module: { |
39 | 41 | ||
40 | rules: [ | 42 | rules: [ |
diff --git a/server/helpers/custom-validators/activitypub/activity.ts b/server/helpers/custom-validators/activitypub/activity.ts index cabedaf20..1d2ef2ac6 100644 --- a/server/helpers/custom-validators/activitypub/activity.ts +++ b/server/helpers/custom-validators/activitypub/activity.ts | |||
@@ -18,7 +18,7 @@ import { | |||
18 | import { isViewActivityValid } from './view' | 18 | import { isViewActivityValid } from './view' |
19 | 19 | ||
20 | function isRootActivityValid (activity: any) { | 20 | function isRootActivityValid (activity: any) { |
21 | return Array.isArray(activity['@context']) && | 21 | return Array.isArray(activity['@context']) && ( |
22 | ( | 22 | ( |
23 | (activity.type === 'Collection' || activity.type === 'OrderedCollection') && | 23 | (activity.type === 'Collection' || activity.type === 'OrderedCollection') && |
24 | validator.isInt(activity.totalItems, { min: 0 }) && | 24 | validator.isInt(activity.totalItems, { min: 0 }) && |
@@ -28,6 +28,7 @@ function isRootActivityValid (activity: any) { | |||
28 | isActivityPubUrlValid(activity.id) && | 28 | isActivityPubUrlValid(activity.id) && |
29 | (isActivityPubUrlValid(activity.actor) || isActivityPubUrlValid(activity.actor.id)) | 29 | (isActivityPubUrlValid(activity.actor) || isActivityPubUrlValid(activity.actor.id)) |
30 | ) | 30 | ) |
31 | ) | ||
31 | } | 32 | } |
32 | 33 | ||
33 | const activityCheckers: { [ P in ActivityType ]: (activity: Activity) => boolean } = { | 34 | const activityCheckers: { [ P in ActivityType ]: (activity: Activity) => boolean } = { |