in _is_cgi, fix error in return http error status

+ fix error in checking script output : reverse order between calcul of content_length and erasing empty line
This commit is contained in:
Hugo LAMY
2022-08-15 01:52:36 +02:00
parent a6bfea3b56
commit b9d4317f51
3 changed files with 12 additions and 12 deletions

View File

@@ -5,7 +5,7 @@ bool Webserv::_is_cgi(Client *client, std::string path)
{
std::string script_path;
size_t file_type;
size_t file_mode;
size_t file_mode = client->status;
size_t pos = 0;
while (pos != NPOS)
@@ -160,7 +160,6 @@ std::string Webserv::_exec_script(Client *client, char **env)
// for tests execve crash :
//execve("wrong", nll, env);
std::cerr << "execve crashed.\n";
// TODO HUGO : check errno
}
else //parent
@@ -189,8 +188,8 @@ void Webserv::_check_script_output(Client *client, std::string & output)
{
_check_script_status(client, output);
_check_script_fields(client, output);
_add_script_body_length_header(output);
_remove_body_leading_empty_lines(output);
_add_script_body_length_header(output);
// _check_script_empty_lines(client, output);
// _check_script_space_colons(client, output);
// _check_script_new_lines(client, output);