mirror of
https://github.com/weechat/weechat.git
synced 2026-07-09 19:23:13 +02:00
relay/api: always set "body_type" and "body" (null if there is no body) in websocket frame
This commit is contained in:
@@ -174,17 +174,17 @@ relay_api_msg_send_json_internal (struct t_relay_client *client,
|
||||
cJSON_AddItemToObject (
|
||||
json, "request_body",
|
||||
(client->http_req->body) ?
|
||||
cJSON_Parse (client->http_req->body) :cJSON_CreateNull ());
|
||||
cJSON_Parse (client->http_req->body) : cJSON_CreateNull ());
|
||||
free (request);
|
||||
}
|
||||
}
|
||||
if (body_type)
|
||||
{
|
||||
cJSON_AddItemToObject (json, "body_type",
|
||||
cJSON_CreateString (body_type));
|
||||
}
|
||||
if (json_body)
|
||||
cJSON_AddItemToObject (json, "body", json_body);
|
||||
cJSON_AddItemToObject (
|
||||
json, "body_type",
|
||||
(body_type) ?
|
||||
cJSON_CreateString (body_type) : cJSON_CreateNull ());
|
||||
cJSON_AddItemToObject (
|
||||
json, "body",
|
||||
(json_body) ? json_body : cJSON_CreateNull ());
|
||||
string = cJSON_PrintUnformatted (json);
|
||||
num_bytes = relay_client_send (
|
||||
client,
|
||||
|
||||
Reference in New Issue
Block a user