Invalid JSON data makes the server crash
mighe opened this issue · 2 comments
mighe commented
When an invalid JSON string is sent to the server, the function parse_post_body raises a ParseError and it crashes.
I think the best approach would be sending back to the client an halt 400
(BadRequest).
To do so we have a couple of ways:
- make the
params
evaluation eager and catch the exception - every request handler is executed in a safer way and it sends the error code when an error is raised
Probably the latter is a bit better because it will make more reliable every Angelo instance without overhead.
What do you think?
kenichi commented