Bugfixes: answer was not deleted before filled again; Header/Body separation was broken
This commit is contained in:
parent
76ffc28690
commit
311581345a
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required (VERSION 3.7)
|
||||
project (mastodon-cpp
|
||||
VERSION 0.6.2
|
||||
VERSION 0.6.3
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
|
|
|
@ -112,10 +112,14 @@ const std::uint16_t API::http::request_sync(const method &meth,
|
|||
break;
|
||||
}
|
||||
|
||||
//request.setOpt<curlopts::Verbose>(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)
|
||||
|
|
Reference in New Issue