1
0
Fork 0

Fix validators issue

This commit is contained in:
Chocobozzz 2017-12-19 18:09:44 +01:00
parent 6e1b11a750
commit 57f11c187b
No known key found for this signature in database
GPG key ID: 583A612D890159BE
2 changed files with 3 additions and 3 deletions

View file

@ -5,8 +5,8 @@ function isAnnounceActivityValid (activity: any) {
console.log(activity)
return isBaseActivityValid(activity, 'Announce') &&
(
isActivityPubUrlValid(activity.object) ||
isVideoTorrentCreateActivityValid(activity.object)
isVideoTorrentCreateActivityValid(activity.object) ||
isActivityPubUrlValid(activity.object)
)
}

View file

@ -17,7 +17,7 @@ function isActivityPubUrlValid (url: string) {
isURLOptions.require_tld = false
}
return exists(url) && validator.isURL(url, isURLOptions) && validator.isLength(url, CONSTRAINTS_FIELDS.ACTOR.URL)
return exists(url) && validator.isURL('' + url, isURLOptions) && validator.isLength('' + url, CONSTRAINTS_FIELDS.ACTOR.URL)
}
function isBaseActivityValid (activity: any, type: string) {