From 26e06e42a1236a0eb70e522d1b3bd96825285169 Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 26 Jan 2018 00:24:00 +0100 Subject: [PATCH] typo in post(), doc updated --- CMakeLists.txt | 2 +- README.md | 2 +- src/api_post.cpp | 2 +- src/http_sync.cpp | 7 +++++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a109a32..1cbf579 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.7) include(GNUInstallDirs) project (mastodon-cpp - VERSION 0.2.0 + VERSION 0.2.1 LANGUAGES CXX ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fPIC") diff --git a/README.md b/README.md index e666adb..b7a9c67 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ All versions below 1.0.0 (SOVERSION 0) are considered insecure, unstable and can ## Dependencies * Tested OS: Linux - * C++ compiler (tested: gcc 6.4) + * C++ compiler (tested: gcc 6.4, clang 5.0) * [cmake](https://cmake.org/) (tested: 3.9.6) * [boost](http://www.boost.org/) (tested: 1.63.0) * Optional: [doxygen](https://www.stack.nl/~dimitri/doxygen/) (tested: 1.8.13) diff --git a/src/api_post.cpp b/src/api_post.cpp index 2cfafc2..3b769e7 100644 --- a/src/api_post.cpp +++ b/src/api_post.cpp @@ -36,7 +36,7 @@ const std::uint16_t API::post(const Mastodon::API::v1 &call, switch (call) { - case v1::accounts_id_follow: + case v1::apps: strcall = "/api/v1/apps"; break; case v1::domain_blocks: diff --git a/src/http_sync.cpp b/src/http_sync.cpp index 48637dc..57c1d75 100644 --- a/src/http_sync.cpp +++ b/src/http_sync.cpp @@ -126,8 +126,11 @@ const std::uint16_t API::http::request_sync(const method &meth, request_stream << "Accept: */*\r\n"; request_stream << "Connection: close\r\n"; request_stream << "User-Agent: " << parent.get_useragent() << "\r\n"; - request_stream << "Authorization: Bearer " - << _access_token << "\r\n"; + if (!_access_token.empty()) + { + request_stream << "Authorization: Bearer " + << _access_token << "\r\n"; + } switch (meth) { case http::method::GET: