Commit 8910bfe4370010dd3c02beb7f4096a05bbf61856

Authored by Adhidarma Hadiwinoto
1 parent b7d56386e4
Exists in master

conditional ipfilter

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

lib/http-listener.js
... ... @@ -52,7 +52,7 @@ function mainHandler(req, res) {
52 52 })
53 53 }
54 54  
55   -app.use(ipfilter(config.ip_whitelist, {mode: 'allow', log: false}));
  55 +config.ip_whitelist && config.ip_whitelist.length && app.use(ipfilter(config.ip_whitelist, {mode: 'allow', log: false}));
56 56  
57 57 app.get('/', mainHandler);
58 58 app.post('/', bodyParser.urlencoded({extended: true}), mainHandler);