1 import { CONFIG } from '../../initializers'
2 import { exists } from './misc'
4 function isWebfingerResourceValid (value: string) {
5 if (!exists(value)) return false
6 if (value.startsWith('acct:') === false) return false
8 const actorWithHost = value.substr(5)
9 const actorParts = actorWithHost.split('@')
10 if (actorParts.length !== 2) return false
12 const host = actorParts[1]
14 return host === CONFIG.WEBSERVER.HOST
17 // ---------------------------------------------------------------------------
20 isWebfingerResourceValid