Skip to content

Commit

Permalink
fix IP issue #2812
Browse files Browse the repository at this point in the history
  • Loading branch information
smashah authored Aug 16, 2022
1 parent 896ee92 commit e5c68c9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cli/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export const setupHttpServer = (cliConfig: cliFlags) => {
if(cliConfig.allowIps){
let allowIps = cliConfig.allowIps as string[] | string
if(!Array.isArray(cliConfig.allowIps)) allowIps = [cliConfig.allowIps as string]
app.use(IpFilter(allowIps as string[], { mode: 'allow' }))
if(Array.isArray(allowIps) && allowIps.length > 0 && allowIps[0]) {
console.log("Allowed IPs", allowIps)
app.use(IpFilter(allowIps as string[], { mode: 'allow' }))
}
}
if(cliConfig.helmet) {
//@ts-ignore
Expand Down Expand Up @@ -386,4 +389,4 @@ export const setupSocketServer : (cliConfig, client : Client) => Promise<void> =
return;
});
});
}
}

0 comments on commit e5c68c9

Please sign in to comment.