Fix for issue #950

Changed 'server.js' to allow an empty ipwhitelist to allow any and all hosts instead of none as mentioned in the documentation
This commit is contained in:
Unknown 2017-07-17 14:23:24 +02:00
parent 86ae704e86
commit a7297d2685
7 changed files with 35 additions and 32 deletions

View file

@ -30,7 +30,7 @@ var Server = function(config, callback) {
}
app.use(function(req, res, next) {
var result = ipfilter(config.ipWhitelist, {mode: "allow", log: false})(req, res, function(err) {
var result = ipfilter(config.ipWhitelist, {mode: config.ipWhitelist.length === 0 ? "deny" : "allow", log: false})(req, res, function(err) {
if (err === undefined) {
return next();
}