Fix validators issue
This commit is contained in:
parent
6e1b11a750
commit
57f11c187b
2 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue