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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user