diff --git a/controllers/agents.js b/controllers/agents.js index 8e82bb2c..56009675 100644 --- a/controllers/agents.js +++ b/controllers/agents.js @@ -957,7 +957,9 @@ router.delete('/', function(req, res) { return; } - data_request['arguments']['purge'] = 'purge' in req.query && (req.query['purge'] == true || req.query['purge'] == 'true'); + logger.debug('purge' in req.query && (req.query.purge == 'true' || req.query.purge == '')); + + data_request['arguments']['purge'] = 'purge' in req.query && (req.query.purge == true || req.query.purge == ''); if ('ids' in req.body) data_request['arguments']['list_agent_ids'] = req.body.ids; diff --git a/helpers/input_validation.js b/helpers/input_validation.js index 43310661..b4fd72be 100755 --- a/helpers/input_validation.js +++ b/helpers/input_validation.js @@ -145,7 +145,7 @@ exports.timeframe_type = function(param) { exports.boolean = function(n) { if (typeof n != 'undefined'){ - var regex = /^true|false$/; + var regex = /^$|(^true|false$)/; return regex.test(n); } else