Skip to content

Commit

Permalink
Merge pull request #48 from babelouest/curl-http-https
Browse files Browse the repository at this point in the history
Use CURLOPT_REDIR_PROTOCOLS_STR when curl >= 7.85.0
  • Loading branch information
zandbelt committed Nov 11, 2023
2 parents 2c8f93f + 02f0a8a commit 6851bb3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,10 +1007,17 @@ bool oauth2_http_call(oauth2_log_t *log, const char *url, const char *data,
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&buf);

#ifndef LIBCURL_NO_CURLPROTO
#if CURL_AT_LEAST_VERSION(7,85,0)
curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS_STR,
"http,https");
curl_easy_setopt(curl, CURLOPT_PROTOCOLS_STR,
"http,https");
#else
curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS,
CURLPROTO_HTTP | CURLPROTO_HTTPS);
curl_easy_setopt(curl, CURLOPT_PROTOCOLS,
CURLPROTO_HTTP | CURLPROTO_HTTPS);
#endif
#endif

if (ctx) {
Expand Down

0 comments on commit 6851bb3

Please sign in to comment.