diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2024-01-31 08:59:02 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2024-02-01 21:39:23 +0100 |
commit | de72fe1db5a3175fe3205b5dad3f714bbb1603a3 (patch) | |
tree | 4b4eddc2991cded5024e7d014818decafe715696 /src | |
parent | 89aeb03a13a39dca75eb061efe9547601c6cfd05 (diff) | |
download | weechat-de72fe1db5a3175fe3205b5dad3f714bbb1603a3.zip |
relay/api: fix send of responses 400 and 404 in case of error (issue #2066)
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/relay/relay-http.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/relay/relay-http.c b/src/plugins/relay/relay-http.c index 5610694dc..ba56f864d 100644 --- a/src/plugins/relay/relay-http.c +++ b/src/plugins/relay/relay-http.c @@ -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); |