Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix AP activity validator

Chocobozzzf6a7c82ca518
diff --git a/client/webpack/webpack.video-embed.js b/client/webpack/webpack.video-embed.js
index 4a8879031d..5a4e35deac 100644
--- a/client/webpack/webpack.video-embed.js
+++ b/client/webpack/webpack.video-embed.js
@@ -35,6 +35,8 @@ module.exports = function () {
publicPath: '/client/standalone/videos/'
},
+ // devtool: 'source-map',
+
module: {
rules: [
diff --git a/server/helpers/custom-validators/activitypub/activity.ts b/server/helpers/custom-validators/activitypub/activity.ts
index cabedaf201..1d2ef2ac6c 100644
--- a/server/helpers/custom-validators/activitypub/activity.ts
+++ b/server/helpers/custom-validators/activitypub/activity.ts
@@ -18,7 +18,7 @@ import {
import { isViewActivityValid } from './view'
function isRootActivityValid (activity: any) {
- return Array.isArray(activity['@context']) &&
+ return Array.isArray(activity['@context']) && (
(
(activity.type === 'Collection' || activity.type === 'OrderedCollection') &&
validator.isInt(activity.totalItems, { min: 0 }) &&
@@ -28,6 +28,7 @@ function isRootActivityValid (activity: any) {
isActivityPubUrlValid(activity.id) &&
(isActivityPubUrlValid(activity.actor) || isActivityPubUrlValid(activity.actor.id))
)
+ )
}
const activityCheckers: { [ P in ActivityType ]: (activity: Activity) => boolean } = {