Header has to match completely in get_header()

This commit is contained in:
tastytea 2018-03-11 15:30:02 +01:00
parent d59f24b97c
commit d3193c08a0
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.7) cmake_minimum_required (VERSION 3.7)
project (mastodon-cpp project (mastodon-cpp
VERSION 0.6.1 VERSION 0.6.2
LANGUAGES CXX LANGUAGES CXX
) )

View File

@ -251,7 +251,7 @@ const string API::get_header(const std::string &header) const
{ {
string headers; string headers;
_http.get_headers(headers); _http.get_headers(headers);
size_t startpos = headers.find(header); size_t startpos = headers.find(header + ':');
if (startpos != std::string::npos) if (startpos != std::string::npos)
{ {
startpos = headers.find(':', startpos) + 2; startpos = headers.find(':', startpos) + 2;