Request body with invalid JSON results in a 500 Internal Server Error response
Opened this issue · 1 comments
malta895 commented
Describe the bug
Performing a PATCH request to an endpoint protected by a Rond policy results in a 500 Internal Server Error if:
- the
Content-Type
isapplication/json
- the body contains an invalid JSON, with syntax errors.
The behavior has been observed on a PATCH request, but it's likely that any other http verb has the same issue.
Expected behavior
A 400 Bad Request error clearly explaning that the JSON in the body is invalid.
Actual Behavior
The server responds with a 500 Internal Server error and the following body:
{
"error": "failed to create rond input",
"message": "Internal server error, please try again later",
"statusCode": 500
}
Replication info
- Rönd version: Latest (
main
) - Running mode: sidecar/standalone
fredmaggiowski commented
I'd expect rönd to reply with something like
{
"error": "malformed body",
"message": "Bad request, the request body is invalid",
"statusCode": 400
}