diff options
author | Roberto Hueso Gómez <rhueso@soleta.eu> | 2019-11-05 11:00:33 +0100 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2019-11-06 11:25:24 +0100 |
commit | acf9cdf8d15b3679c0a7b9ea724b42cdf6b03092 (patch) | |
tree | 51ccedb7d0bdbc8fb50e454342e6f19d567eb7a4 | |
parent | 8901505bb541a68b441a8925c6b1598128344f87 (diff) |
#915 Validate POST /poweroff REST API parameters
This patch ensures that all required parameters are sent in the request.
-rw-r--r-- | sources/ogAdmServer.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sources/ogAdmServer.cpp b/sources/ogAdmServer.cpp index cf06df5..99562e4 100644 --- a/sources/ogAdmServer.cpp +++ b/sources/ogAdmServer.cpp @@ -3862,6 +3862,9 @@ static int og_cmd_poweroff(json_t *element, struct og_msg_params *params) break; } + if (!og_msg_params_validate(params, OG_REST_PARAM_ADDR)) + return -1; + return og_cmd_legacy_send(params, "Apagar", CLIENTE_OCUPADO); } |