aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/utils.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2018-07-25 22:01:25 +0200
committerRigel Kent <sendmemail@rigelk.eu>2018-07-25 22:01:25 +0200
commitc1e791bad0b079af67398f6407221e6dcbb573dd (patch)
tree82e5944b4458dd35aa482a38f6b650eb93bb89ad /server/helpers/utils.ts
parent5f7021c33d31c5255b995ae0ff86b5bbea4ea4b9 (diff)
downloadPeerTube-c1e791bad0b079af67398f6407221e6dcbb573dd.tar.gz
PeerTube-c1e791bad0b079af67398f6407221e6dcbb573dd.tar.zst
PeerTube-c1e791bad0b079af67398f6407221e6dcbb573dd.zip
expliciting type checks and predicates (server only)
Diffstat (limited to 'server/helpers/utils.ts')
-rw-r--r--server/helpers/utils.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/helpers/utils.ts b/server/helpers/utils.ts
index 9efc89d92..7ff1556e3 100644
--- a/server/helpers/utils.ts
+++ b/server/helpers/utils.ts
@@ -52,7 +52,7 @@ async function isSignupAllowed () {
52function isSignupAllowedForCurrentIP (ip: string) { 52function isSignupAllowedForCurrentIP (ip: string) {
53 const addr = ipaddr.parse(ip) 53 const addr = ipaddr.parse(ip)
54 let excludeList = [ 'blacklist' ] 54 let excludeList = [ 'blacklist' ]
55 let matched: string 55 let matched = ''
56 56
57 // if there is a valid, non-empty whitelist, we exclude all unknown adresses too 57 // if there is a valid, non-empty whitelist, we exclude all unknown adresses too
58 if (CONFIG.SIGNUP.FILTERS.CIDR.WHITELIST.filter(cidr => isCidr(cidr)).length > 0) { 58 if (CONFIG.SIGNUP.FILTERS.CIDR.WHITELIST.filter(cidr => isCidr(cidr)).length > 0) {
@@ -144,6 +144,7 @@ let serverActor: ActorModel
144async function getServerActor () { 144async function getServerActor () {
145 if (serverActor === undefined) { 145 if (serverActor === undefined) {
146 const application = await ApplicationModel.load() 146 const application = await ApplicationModel.load()
147 if (!application) throw Error('Could not application.')
147 serverActor = application.Account.Actor 148 serverActor = application.Account.Actor
148 } 149 }
149 150