Browse Source

Add categories sanitizer to search

pull/546/head
Diana Shkolnikov 9 years ago
parent
commit
818711f509
  1. 1
      sanitiser/search.js
  2. 2
      test/unit/sanitiser/search.js

1
sanitiser/search.js

@ -13,6 +13,7 @@ var sanitizeAll = require('../sanitiser/sanitizeAll'),
private: require('../sanitiser/_flag_bool')('private', false),
geo_search: require('../sanitiser/_geo_search'),
boundary_country: require('../sanitiser/_boundary_country'),
categories: require('../sanitiser/_categories')
};
var sanitize = function(req, cb) { sanitizeAll(req, sanitizers, cb); };

2
test/unit/sanitiser/search.js

@ -25,7 +25,7 @@ module.exports.tests.interface = function(test, common) {
module.exports.tests.sanitisers = function(test, common) {
test('check sanitiser list', function (t) {
var expected = ['quattroshapes_deprecation', 'singleScalarParameters', 'text', 'size',
'layers', 'sources', 'sources_and_layers', 'private', 'geo_search', 'boundary_country' ];
'layers', 'sources', 'sources_and_layers', 'private', 'geo_search', 'boundary_country', 'categories' ];
t.deepEqual(Object.keys(search.sanitiser_list), expected);
t.end();
});

Loading…
Cancel
Save