Module: kamailio
Branch: master
Commit: 4d8263f9be97a541a24cbc6acc9855509640780b
URL:
https://github.com/kamailio/kamailio/commit/4d8263f9be97a541a24cbc6acc98555…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-06-22T14:37:18+02:00
http_client: fix depecration of CURLOPT_REDIR_PROTOCOLS
- GH #3492
---
Modified: src/modules/http_client/functions.c
---
Diff:
https://github.com/kamailio/kamailio/commit/4d8263f9be97a541a24cbc6acc98555…
Patch:
https://github.com/kamailio/kamailio/commit/4d8263f9be97a541a24cbc6acc98555…
---
diff --git a/src/modules/http_client/functions.c b/src/modules/http_client/functions.c
index a5316972d45..118adc8656d 100644
--- a/src/modules/http_client/functions.c
+++ b/src/modules/http_client/functions.c
@@ -161,8 +161,13 @@ static int curL_request_url(struct sip_msg *_m, const char *_met,
res = curl_easy_setopt(
curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
#endif
+
+#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 85, 0)
+ res = curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS_STR, "http,https");
+#else
res = curl_easy_setopt(
curl, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
+#endif
if(_met != NULL) {
/* Enforce method (GET, PUT, ...) */