Details
-
Suggestion
-
Resolution: Duplicate
-
None
-
None
-
None
Description
Using the Stash REST API and sending POST or PUT requests, if the JSON payload is not formated correctly the Stash server returns HTTP 500 instead of HTTP 400.
- STEPS TO REPRODUCE
curl -H "Authorization: Basic ..." -H "Content-Type: application/json" -X PUT -d ' " {hook-url-0" : "some-url"}' 'https://stash.example.com/rest/api/1.0/projects/
{projectKey}/repos/
{repositorySlug}/settings/hooks/
{hookKey}/enabled
Note that the payload is not correct JSON.
- RESULTS
Stash returns
HTTP/1.1 500 Internal Server Error
{
"errors": [ { "context": null, "exceptionName": null, "message": "An error occurred while processing the request. Check the server logs for more information." }]
}
Stash should return,
400 Bad Request
Attachments
Issue Links
- duplicates
-
BSERV-4276 Output 400 rather than 500 error when Stash can't recognize/parse JSON objects properly
- Closed
- is related to
-
BSERV-4276 Output 400 rather than 500 error when Stash can't recognize/parse JSON objects properly
- Closed