Browse Source

Add details sanitizer to suggest/coarse

pull/103/head
Diana Shkolnikov 10 years ago
parent
commit
8c22f33dc7
  1. 3
      sanitiser/coarse.js
  2. 3
      test/unit/sanitiser/coarse.js

3
sanitiser/coarse.js

@ -9,7 +9,8 @@ var logger = require('../src/logger'),
var layers = require('../sanitiser/_layers'); var layers = require('../sanitiser/_layers');
return layers(req); return layers(req);
}, },
latlonzoom: require('../sanitiser/_geo') latlonzoom: require('../sanitiser/_geo'),
details: require('../sanitiser/_details')
}; };
var sanitize = function(req, cb) { _sanitize(req, sanitizers, cb); }; var sanitize = function(req, cb) { _sanitize(req, sanitizers, cb); };

3
test/unit/sanitiser/coarse.js

@ -53,7 +53,8 @@ module.exports.tests.middleware_success = function(test, common) {
size: 10, size: 10,
layers: [ 'admin0', 'admin1', 'admin2', 'neighborhood', 'locality', 'local_admin' ], layers: [ 'admin0', 'admin1', 'admin2', 'neighborhood', 'locality', 'local_admin' ],
lat: 0, lat: 0,
lon: 0 lon: 0,
details: true
}; };
t.equal(message, undefined, 'no error message set'); t.equal(message, undefined, 'no error message set');
t.deepEqual(req.clean, defaultClean); t.deepEqual(req.clean, defaultClean);

Loading…
Cancel
Save