diff --git a/CMakeLists.txt b/CMakeLists.txt index 15dd2d0..f5dfce1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (mastodon-cpp - VERSION 0.6.2 + VERSION 0.6.3 LANGUAGES CXX ) diff --git a/src/http_sync.cpp b/src/http_sync.cpp index eec563d..361b67d 100644 --- a/src/http_sync.cpp +++ b/src/http_sync.cpp @@ -112,10 +112,14 @@ const std::uint16_t API::http::request_sync(const method &meth, break; } + //request.setOpt(true); + + answer.clear(); request.perform(); ret = curlpp::infos::ResponseCode::get(request); ttdebug << "Response code: " << ret << '\n'; - size_t pos = answer.find("\r\n\r\n"); + // Work around "HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK" + size_t pos = answer.find("\r\n\r\n", 25); _headers = answer.substr(0, pos); if (ret == 200 || ret == 302 || ret == 307)