From f6a7c82ca51896a433bc2264c52afd6981c7c4c6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 29 May 2018 15:05:03 +0200 Subject: [PATCH] Fix AP activity validator --- client/webpack/webpack.video-embed.js | 2 ++ server/helpers/custom-validators/activitypub/activity.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) 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 () { 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 cabedaf20..1d2ef2ac6 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 } = { -- 2.25.1