Module: kamailio Branch: master Commit: ce58411c462231d6ea1fc3b4acbf50520c2962ce URL: https://github.com/kamailio/kamailio/commit/ce58411c462231d6ea1fc3b4acbf5052...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2020-12-16T20:54:57+01:00
http_client: do not set empty headers and body
---
Modified: src/modules/http_client/http_client.c
---
Diff: https://github.com/kamailio/kamailio/commit/ce58411c462231d6ea1fc3b4acbf5052... Patch: https://github.com/kamailio/kamailio/commit/ce58411c462231d6ea1fc3b4acbf5052...
---
diff --git a/src/modules/http_client/http_client.c b/src/modules/http_client/http_client.c index 177e50eb14..e34dae58fd 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;