From ce58411c462231d6ea1fc3b4acbf50520c2962ce Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Wed, 16 Dec 2020 20:54:57 +0100 Subject: [PATCH] http_client: do not set empty headers and body --- src/modules/http_client/http_client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/http_client/http_client.c b/src/modules/http_client/http_client.c index 177e50eb147..e34dae58fd3 100644 --- a/src/modules/http_client/http_client.c +++ b/src/modules/http_client/http_client.c @@ -894,8 +894,9 @@ static int ki_http_query_helper(sip_msg_t *_m, str *url, str *post, str *hdrs, LM_ERR("invalid url parameter\n"); return -1; } - ret = http_client_query(_m, url->s, &result, (post && post->s)?post->s:NULL, - (hdrs && hdrs->s)?hdrs->s:NULL); + ret = http_client_query(_m, url->s, &result, + (post && post->s && post->len>0)?post->s:NULL, + (hdrs && hdrs->s && hdrs->len>0)?hdrs->s:NULL); val.rs = result; val.flags = PV_VAL_STR;