abedev / abe

API for Back-End (Haxe, NodeJS and Express)
54 stars 10 forks source link

When non-url params don't match, don't send a 404 #55

Open mlms13 opened 9 years ago

mlms13 commented 9 years ago

Right now when params don't match, we're falling through to the next route handler (and eventually sending a 404 if nothing "matches"). This is a reasonable thing to do for non-matching URL params (e.g. an Int :id when we're expecting a String).

However, it's arguably a bit strange to send a 404 when you POST some params in the body, but you're missing a required param. The route isn't actually 404, it's just a 400 bad request.