Module: kamailio Branch: 5.7 Commit: 2bd813b0c4c1b942ee634eca5e68a025be9fab8e URL: https://github.com/kamailio/kamailio/commit/2bd813b0c4c1b942ee634eca5e68a025...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Victor Seva linuxmaniac@torreviejawireless.org Date: 2023-06-23T08:54:57+02:00
http_client: fix depecration of CURLOPT_REDIR_PROTOCOLS
- GH #3492
(cherry picked from commit 4d8263f9be97a541a24cbc6acc9855509640780b)
---
Modified: src/modules/http_client/functions.c
---
Diff: https://github.com/kamailio/kamailio/commit/2bd813b0c4c1b942ee634eca5e68a025... Patch: https://github.com/kamailio/kamailio/commit/2bd813b0c4c1b942ee634eca5e68a025...
---
diff --git a/src/modules/http_client/functions.c b/src/modules/http_client/functions.c index be0b2024b0d..8b1f33d74ef 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, ...) */