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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user