| 1 | #include "cpr/bearer.h" |
|---|---|
| 2 | #include "cpr/util.h" |
| 3 | |
| 4 | namespace cpr { |
| 5 | // Only supported with libcurl >= 7.61.0. |
| 6 | // As an alternative use SetHeader and add the token manually. |
| 7 | #if LIBCURL_VERSION_NUM >= 0x073D00 |
| 8 | Bearer::~Bearer() noexcept { |
| 9 | util::secureStringClear(s&: token_string_); |
| 10 | } |
| 11 | |
| 12 | const char* Bearer::GetToken() const noexcept { |
| 13 | return token_string_.c_str(); |
| 14 | } |
| 15 | #endif |
| 16 | } // namespace cpr |
| 17 |