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

relay/api: fix send of responses 400 and 404 in case of error (issue #2066)

This commit is contained in:
Sébastien Helleu
2024-01-31 08:59:02 +01:00
parent 89aeb03a13
commit de72fe1db5
+7 -3
View File
@@ -1217,7 +1217,7 @@ relay_http_send_json (struct t_relay_client *client,
int num_bytes, length;
char *headers2;
if (!client || !message || !json_string)
if (!client || !message)
return -1;
num_bytes = -1;
@@ -1234,8 +1234,12 @@ relay_http_send_json (struct t_relay_client *client,
"Content-Type: application/json; charset=utf-8");
}
num_bytes = relay_http_send (client, return_code, message, headers2,
json_string, strlen (json_string));
num_bytes = relay_http_send (client,
return_code,
message,
headers2,
json_string,
(json_string) ? strlen (json_string) : 0);
if (headers2)
free (headers2);