1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 22:06:38 +02:00

relay/api: reply HTTP 400 (Bad Request) when the body received is not a dict in websocket data

This commit is contained in:
Sébastien Helleu
2024-10-29 22:38:28 +01:00
parent 26e16fdea7
commit ad6ec011bd
2 changed files with 3 additions and 0 deletions
@@ -957,6 +957,8 @@ relay_api_protocol_recv_json_request (struct t_relay_client *client,
json_body = cJSON_GetObjectItem (json, "body");
if (json_body)
{
if (!cJSON_IsObject (json_body))
goto error;
string_body = cJSON_PrintUnformatted (json_body);
if (string_body)
{