Bugfix: Do not assume client_id, client_secret and token are hexadecimal.
the build was successful Details

This commit is contained in:
tastytea 2019-02-04 19:14:41 +01:00
parent 0cbfb415b5
commit ffaf4a551a
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.6)
project (mastodon-cpp
VERSION 0.30.0
VERSION 0.30.1
LANGUAGES CXX
)

View File

@ -182,8 +182,8 @@ uint_fast16_t API::register_app1(const string &client_name,
if (ret == 0)
{
std::smatch match;
std::regex reid("client_id\":\"([0-9a-fA-F]+)\"");
std::regex resecret("client_secret\":\"([0-9a-fA-F]+)\"");
std::regex reid("client_id\":\"([^\"]+)\"");
std::regex resecret("client_secret\":\"([^\"]+)\"");
std::regex_search(answer, match, reid);
client_id = match[1].str();
@ -244,7 +244,7 @@ uint_fast16_t API::register_app2(const string &client_id,
if (ret == 0)
{
std::smatch match;
std::regex retoken("access_token\":\"([0-9a-fA-F]+)\"");
std::regex retoken("access_token\":\"([^\"]+)\"");
std::regex_search(answer, match, retoken);
access_token = match[1].str();