Fix AP activity validator
authorChocobozzz <me@florianbigard.com>
Tue, 29 May 2018 13:05:03 +0000 (15:05 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 29 May 2018 13:05:14 +0000 (15:05 +0200)
client/webpack/webpack.video-embed.js
server/helpers/custom-validators/activitypub/activity.ts

index 4a8879031d50abefe6aef338b767dbb0eb1c9df8..5a4e35deac3e1ce5e9599b7e396e9dc7cce07dc9 100644 (file)
@@ -35,6 +35,8 @@ module.exports = function () {
       publicPath: '/client/standalone/videos/'
     },
 
+    // devtool: 'source-map',
+
     module: {
 
       rules: [
index cabedaf201592bb6a8e7fdbe0af802e4e6f21e07..1d2ef2ac6cfe56013aacf83a7fa55a735a7d175f 100644 (file)
@@ -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 } = {