MXS-1220: Return 403 Forbidden for invalid requests

The JSON API specification suggests that the API returns the 403 Forbidden
error when the user does an invalid request. The 400 Bad Request isn't the
ideal error for cases where the syntax is correct but the action being
performed is wrong.
This commit is contained in:
Markus Mäkelä
2017-05-05 05:39:23 +03:00
parent 798ee840a8
commit 1d98b4b67b
3 changed files with 21 additions and 11 deletions

View File

@ -28,6 +28,10 @@ MXS_BEGIN_DECLS
#define MXS_JSON_API_MONITORS "/monitors/"
#define MXS_JSON_API_SESSIONS "/sessions/"
#define MXS_JSON_API_MAXSCALE "/maxscale/"
#define MXS_JSON_API_THREADS "/maxscale/threads/"
#define MXS_JSON_API_LOGS "/maxscale/logs/"
#define MXS_JSON_API_TASKS "/maxscale/tasks/"
#define MXS_JSON_API_MODULES "/maxscale/modules/"
/**
* @brief Create a JSON object