correction of trim in case of str only fill with delim char

+ added a new split, that also does trim, to split without counting newlines
This commit is contained in:
hugogogo
2022-08-10 20:01:23 +02:00
parent c7905ebd19
commit 9a379c835d
5 changed files with 59 additions and 37 deletions

View File

@@ -200,10 +200,12 @@ std::string Client::get_rq_headers(const std::string & key) const
void Client::_parse_request_line()
{
std::vector<std::string> line;
std::string raw_line;
int ret;
ret = ::parse_http_first_line(raw_request, line);
if (ret != 3)
raw_line = extract_line();
line = ::parse_http_first_line(raw_line);
if (line.size() != 3)
{
std::cerr << "err _parse_first_line(): wrong number of elements (" << ret << " instead of 3)\n";
status = 400; // "bad request"