Define CURLAUTH_BEARER as CURLAUTH_ANY with libcurl < 7.61.0
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
tastytea 2020-01-10 17:43:50 +01:00
parent 20167fdce3
commit f601e770ac
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07

View File

@ -183,17 +183,12 @@ void CURLWrapper::set_access_token(const string_view access_token)
_curl_buffer_error};
}
#if LIBCURL_VERSION_NUM >= 0x073d00 // libcurl >= 7.61.0.
{
//NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg,hicpp-signed-bitwise)
code = curl_easy_setopt(_connection, CURLOPT_HTTPAUTH, CURLAUTH_BEARER);
}
#else
{
//NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg,hicpp-signed-bitwise)
code = curl_easy_setopt(_connection, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
}
#endif
#if (LIBCURL_VERSION_NUM < 0x073d00) // libcurl < 7.61.0.
#define CURLAUTH_BEARER CURLAUTH_ANY
#endif
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg, hicpp-signed-bitwise)
code = curl_easy_setopt(_connection, CURLOPT_HTTPAUTH, CURLAUTH_BEARER);
if (code != CURLE_OK)
{
throw CURLException{code, "Could not set authorization token.",