fix: segv

This commit is contained in:
Talyx
2022-02-16 00:16:16 +03:00
parent f7f1793722
commit 5a03f111ec
3 changed files with 21 additions and 27 deletions

View File

@@ -228,6 +228,8 @@ std::string Response::getFullURI(void)
else
ret = tmp;
DBOUT << PINK << "location " << _location->location << ENDL;
DBOUT << PINK << "fullURI " << ret << ENDL;
return (ret);
}
@@ -415,14 +417,6 @@ void Response::methodPost(void)
_body.erase(_body.begin(), _body.begin() + pos + 4);
}
}
else
{
std::ofstream outfile(_fullURI.c_str(), std::ios::out | std::ios::binary);
outfile.write(_request.getBody().data(), _request.getBody().size());
outfile.close();
_code = 204;
}
setHeaderBlocks();
generateHeader();
DBOUT << GREEN << "POST method called" << ENDL;