added trim in utils, added parse request header, mv pdf in docs

This commit is contained in:
hugogogo
2022-08-01 00:07:51 +02:00
parent cbb1d12d54
commit 031932e887
10 changed files with 107 additions and 30 deletions

View File

@@ -83,8 +83,8 @@ void Webserv::_insert_status_line(Client *client)
void Webserv::_get_ressource(Client *client)
{
std::ifstream ifd; // For chunk, ifstream directly in struct CLient for multiples read without close() ?
char buf[MAX_FILESIZE+1];
char *tmp;
char buf[MAX_FILESIZE+1];
const char *tmp;
// Mini parsing à l'arrache du PATH
std::string path;
@@ -128,10 +128,8 @@ void Webserv::_get_ressource(Client *client)
client->response.append("Content-Type: text/html; charset=UTF-8\r\n");
client->response.append("Content-Length: ");
// tmp = ::ft_itoa(ifd.gcount());
tmp = ::itoa(ifd.gcount());
tmp = ::itoa(ifd.gcount()).c_str();
client->response.append(tmp);
// delete tmp;
client->response.append("\r\n");
// Body