diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-19 18:09:44 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-20 09:05:16 +0100 |
commit | 57f11c187b8d57afdce0172be3efda5757865d44 (patch) | |
tree | 7e5e00de899f27b9ee0babfbd7e51a13c0f167b5 | |
parent | 6e1b11a750cc1d41d3c13cbcfe4aabef35cab148 (diff) | |
download | PeerTube-57f11c187b8d57afdce0172be3efda5757865d44.tar.gz PeerTube-57f11c187b8d57afdce0172be3efda5757865d44.tar.zst PeerTube-57f11c187b8d57afdce0172be3efda5757865d44.zip |
Fix validators issue
-rw-r--r-- | server/helpers/custom-validators/activitypub/announce.ts | 4 | ||||
-rw-r--r-- | server/helpers/custom-validators/activitypub/misc.ts | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/server/helpers/custom-validators/activitypub/announce.ts b/server/helpers/custom-validators/activitypub/announce.ts index 469ed5127..1baea4f60 100644 --- a/server/helpers/custom-validators/activitypub/announce.ts +++ b/server/helpers/custom-validators/activitypub/announce.ts | |||
@@ -5,8 +5,8 @@ function isAnnounceActivityValid (activity: any) { | |||
5 | console.log(activity) | 5 | console.log(activity) |
6 | return isBaseActivityValid(activity, 'Announce') && | 6 | return isBaseActivityValid(activity, 'Announce') && |
7 | ( | 7 | ( |
8 | isActivityPubUrlValid(activity.object) || | 8 | isVideoTorrentCreateActivityValid(activity.object) || |
9 | isVideoTorrentCreateActivityValid(activity.object) | 9 | isActivityPubUrlValid(activity.object) |
10 | ) | 10 | ) |
11 | } | 11 | } |
12 | 12 | ||
diff --git a/server/helpers/custom-validators/activitypub/misc.ts b/server/helpers/custom-validators/activitypub/misc.ts index 3ca4e4ff4..aa6ffc9bd 100644 --- a/server/helpers/custom-validators/activitypub/misc.ts +++ b/server/helpers/custom-validators/activitypub/misc.ts | |||
@@ -17,7 +17,7 @@ function isActivityPubUrlValid (url: string) { | |||
17 | isURLOptions.require_tld = false | 17 | isURLOptions.require_tld = false |
18 | } | 18 | } |
19 | 19 | ||
20 | return exists(url) && validator.isURL(url, isURLOptions) && validator.isLength(url, CONSTRAINTS_FIELDS.ACTOR.URL) | 20 | return exists(url) && validator.isURL('' + url, isURLOptions) && validator.isLength('' + url, CONSTRAINTS_FIELDS.ACTOR.URL) |
21 | } | 21 | } |
22 | 22 | ||
23 | function isBaseActivityValid (activity: any, type: string) { | 23 | function isBaseActivityValid (activity: any, type: string) { |