Module: kamailio
Branch: 5.4
Commit: d9df74d43d736dd330f4f9aa364a9f0560717e1a
URL:
https://github.com/kamailio/kamailio/commit/d9df74d43d736dd330f4f9aa364a9f0…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-12-16T21:03:23+01:00
http_client: do not set empty headers and body
(cherry picked from commit ce58411c462231d6ea1fc3b4acbf50520c2962ce)
---
Modified: src/modules/http_client/http_client.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d9df74d43d736dd330f4f9aa364a9f0…
Patch:
https://github.com/kamailio/kamailio/commit/d9df74d43d736dd330f4f9aa364a9f0…
---
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;