api icon indicating copy to clipboard operation
api copied to clipboard

duplicate invalid param 'text' warning for /v1/search

Open missinglink opened this issue 3 years ago • 4 comments

/v1/search

Screenshot 2022-04-21 at 12 18 02

/v1/autocomplete

Screenshot 2022-04-21 at 12 18 12

missinglink avatar Apr 21 '22 10:04 missinglink

Wow, never noticed that before. I wonder where it comes from.

orangejulius avatar Apr 21 '22 16:04 orangejulius

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

missinglink avatar Apr 21 '22 18:04 missinglink

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.

missinglink avatar Apr 21 '22 18:04 missinglink

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).

missinglink avatar Apr 21 '22 18:04 missinglink