]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/helpers/custom-validators/activitypub/misc.ts
Begin activitypub
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / activitypub / misc.ts
1 import { exists } from '../misc'
2
3 function isActivityPubUrlValid (url: string) {
4 const isURLOptions = {
5 require_host: true,
6 require_tld: true,
7 require_protocol: true,
8 require_valid_protocol: true,
9 protocols: [ 'http', 'https' ]
10 }
11
12 return exists(url) && validator.isURL(url, isURLOptions)
13 }
14
15 export {
16 isActivityPubUrlValid
17 }