Fixed HTTP response code not being parsed

Forgot to parse it, when re-writing HTTP response parser.
This commit is contained in:
Fred Nicolson 2017-06-09 11:22:21 +01:00
parent 8284644769
commit 96567f4338

View File

@ -71,6 +71,13 @@ namespace fr
std::vector<std::string> header_lines = split_string(body.substr(0, header_end_pos));
if(header_lines.empty())
return false;
//Get response code
auto status_begin = header_lines[0].find(' ');
if(status_begin == std::string::npos)
return false;
auto end_pos = header_lines[0].find(' ', status_begin + 1);
status = (RequestStatus)std::stoi(header_lines[0].substr(status_begin, end_pos - status_begin));
line++;
//Read in headers