From 7519127b5cb44095f78f6bf4c51d4ebf2b7d5e88 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 11 Feb 2019 14:41:55 +0100 Subject: Add originallyPublishedAt unit tests --- server/helpers/custom-validators/activitypub/videos.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'server/helpers/custom-validators') diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts index 53ad0588d..d94333151 100644 --- a/server/helpers/custom-validators/activitypub/videos.ts +++ b/server/helpers/custom-validators/activitypub/videos.ts @@ -54,6 +54,7 @@ function sanitizeAndCheckVideoTorrentObject (video: any) { isBooleanValid(video.downloadEnabled) && isDateValid(video.published) && isDateValid(video.updated) && + (!video.originallyPublishedAt || isDateValid(video.originallyPublishedAt)) && (!video.content || isRemoteVideoContentValid(video.mediaType, video.content)) && isRemoteVideoIconValid(video.icon) && video.url.length !== 0 && -- cgit v1.2.3