Skip to content

Commit

Permalink
Merge pull request #865 from cmitu/curl-warning
Browse files Browse the repository at this point in the history
Handle cURL library deprecation for redirect options
  • Loading branch information
pjft authored Feb 21, 2024
2 parents 7b45bf7 + d544c73 commit 3ed0ac6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions es-core/src/HttpReq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@ HttpReq::HttpReq(const std::string& url)
}

//set curl restrict redirect protocols
//starting with 7.85.0, CURLOPT_REDIR_PROTOCOLS is deprecated
// and CURLOPT_REDIR_PROTOCOLS_STR should be used instead
#if CURL_AT_LEAST_VERSION(7,85,0)
err = curl_easy_setopt(mHandle, CURLOPT_REDIR_PROTOCOLS_STR, "http,https");
#else
err = curl_easy_setopt(mHandle, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
#endif
if(err != CURLE_OK)
{
mStatus = REQ_IO_ERROR;
Expand Down

0 comments on commit 3ed0ac6

Please sign in to comment.