Fix validators issue
This commit is contained in:
parent
6e1b11a750
commit
57f11c187b
|
@ -5,8 +5,8 @@ function isAnnounceActivityValid (activity: any) {
|
||||||
console.log(activity)
|
console.log(activity)
|
||||||
return isBaseActivityValid(activity, 'Announce') &&
|
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
|
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) {
|
function isBaseActivityValid (activity: any, type: string) {
|
||||||
|
|
Loading…
Reference in New Issue