mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
Begin activitypub
This commit is contained in:
parent
343ad675f2
commit
e4f97babf7
92 changed files with 2507 additions and 920 deletions
17
server/helpers/custom-validators/activitypub/misc.ts
Normal file
17
server/helpers/custom-validators/activitypub/misc.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { exists } from '../misc'
|
||||
|
||||
function isActivityPubUrlValid (url: string) {
|
||||
const isURLOptions = {
|
||||
require_host: true,
|
||||
require_tld: true,
|
||||
require_protocol: true,
|
||||
require_valid_protocol: true,
|
||||
protocols: [ 'http', 'https' ]
|
||||
}
|
||||
|
||||
return exists(url) && validator.isURL(url, isURLOptions)
|
||||
}
|
||||
|
||||
export {
|
||||
isActivityPubUrlValid
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue