api
api copied to clipboard
duplicate invalid param 'text' warning for /v1/search
/v1/search
/v1/autocomplete
Wow, never noticed that before. I wonder where it comes from.
here?
- https://github.com/pelias/api/blob/master/sanitizer/defer_to_pelias_parser.js#L21
- https://github.com/pelias/api/blob/master/routes/v1.js#L215-L224
I think the core issue is that the 'combining sanitizers' (such as https://github.com/pelias/api/blob/master/sanitizer/search.js) should return immediately upon error rather than running through the rest of the route chain.
ie. here https://github.com/pelias/api/blob/master/sanitizer/sanitizeAll.js#L94 it should return something to trigger the err in express middleware (req, res, err).