diff --git a/sanitiser/_layers.js b/sanitiser/_layers.js index 25e8ba26..be13526a 100644 --- a/sanitiser/_layers.js +++ b/sanitiser/_layers.js @@ -16,9 +16,9 @@ function sanitize( req ){ } // default case (no layers specified in GET params) + // don't even set the from_layers key in this case if('string' !== typeof params.layers || !params.layers.length){ - params.layers = 'poi,admin,address'; // default layers - clean.default_layers_set = true; + return { 'error': false }; } // decide which layers can be queried diff --git a/test/unit/query/search.js b/test/unit/query/search.js index c4797f16..ff678401 100644 --- a/test/unit/query/search.js +++ b/test/unit/query/search.js @@ -275,7 +275,6 @@ module.exports.tests.query = function(test, common) { size: 10, details: true, parsed_input: parser.get_parsed_address(address), - default_layers_set: true }); var expected = { @@ -477,7 +476,6 @@ module.exports.tests.query = function(test, common) { size: 10, details: true, parsed_input: parser.get_parsed_address(partial_address), - default_layers_set: true }); var expected = { @@ -645,7 +643,6 @@ module.exports.tests.query = function(test, common) { size: 10, details: true, parsed_input: parser.get_parsed_address(partial_address), - default_layers_set: true }); var expected = { diff --git a/test/unit/sanitiser/reverse.js b/test/unit/sanitiser/reverse.js index d8d666c1..73e3b381 100644 --- a/test/unit/sanitiser/reverse.js +++ b/test/unit/sanitiser/reverse.js @@ -6,16 +6,14 @@ var suggest = require('../../../sanitiser/reverse'), defaultError = 'missing param \'lat\'', defaultClean = { lat:0, types: { - from_layers: [ 'geoname', 'osmnode', 'osmway', 'admin0', 'admin1', 'admin2', 'neighborhood', - 'locality', 'local_admin', 'osmaddress', 'openaddresses' ], }, lon: 0, size: 10, details: true, - default_layers_set: true, categories: [] }, sanitize = function(query, cb) { _sanitize({'query':query}, cb); }; +var all_layers = ( '../../query/indeces' ); module.exports.tests = {}; diff --git a/test/unit/sanitiser/search.js b/test/unit/sanitiser/search.js index e2ccd4ce..9bf695e4 100644 --- a/test/unit/sanitiser/search.js +++ b/test/unit/sanitiser/search.js @@ -9,15 +9,10 @@ var search = require('../../../sanitiser/search'), defaultError = 'invalid param \'input\': text length, must be >0', defaultClean = { input: 'test', types: { - from_layers: [ 'geoname', 'osmnode', 'osmway', 'admin0', 'admin1', 'admin2', 'neighborhood', - 'locality', 'local_admin', 'osmaddress', 'openaddresses' ], - from_address_parsing: [ 'geoname', 'osmnode', 'osmway', 'admin0', 'admin1', 'admin2', 'neighborhood', - 'locality', 'local_admin', 'osmaddress', 'openaddresses' ], }, size: 10, details: true, parsed_input: defaultParsed, - default_layers_set: true }, sanitize = function(query, cb) { _sanitize({'query':query}, cb); }; diff --git a/test/unit/sanitiser/suggest.js b/test/unit/sanitiser/suggest.js index 003b44ae..71f2ed63 100644 --- a/test/unit/sanitiser/suggest.js +++ b/test/unit/sanitiser/suggest.js @@ -15,7 +15,6 @@ var suggest = require('../../../sanitiser/suggest'), lat:0, lon:0, parsed_input: defaultParsed, - default_layers_set: true }, sanitize = function(query, cb) { _sanitize({'query':query}, cb); };