mirror of https://github.com/pelias/api.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
517 B
24 lines
517 B
var fieldsToRemove = ['text', 'focus.point.lat', 'focus.point.lon', |
|
'boundary.circle.lat', 'boundary.circle.lon', 'point.lat', 'point.lon']; |
|
|
|
function isDNT(req) { |
|
if (!req.headers) { |
|
return false; |
|
} |
|
return req.headers.DNT || req.headers.dnt || req.headers.do_not_track; |
|
} |
|
|
|
function removeFields(query) { |
|
fieldsToRemove.forEach(function(field) { |
|
if (query[field]) { |
|
query[field] = '[removed]'; |
|
} |
|
}); |
|
|
|
return query; |
|
} |
|
|
|
module.exports = { |
|
isDNT: isDNT, |
|
removeFields: removeFields |
|
};
|
|
|