Merge branch 'hugo5'

This commit is contained in:
Hugo LAMY
2022-08-16 01:46:52 +02:00
14 changed files with 482 additions and 186 deletions

View File

@@ -222,6 +222,8 @@ std::string Webserv::_exec_script(Client *client, char *env[])
void Webserv::_check_script_output(Client *client, std::string & output)
{
_check_script_status(client, output);
if (client->status >= 400 && client->status < 600)
return;
///*DEBUG*/ std::cout << "\n" B_PURPLE "[script status]:" RESET "\n"; ::print_special(output); std::cout << B_PURPLE "-----------" RESET "\n\n";
_check_script_fields(client, output);
///*DEBUG*/ std::cout << "\n" B_PURPLE "[script fields]:" RESET "\n"; ::print_special(output); std::cout << B_PURPLE "-----------" RESET "\n\n";

View File

@@ -93,7 +93,8 @@ void Webserv::_construct_response(Client *client)
///*DEBUG*/ std::cout << "\n" B_PURPLE "[response]:" RESET "\n"; ::print_special(client->response); std::cout << B_PURPLE "-----------" RESET "\n\n";
///*DEBUG*/ std::cout << "\n" B_PURPLE "[script output]:" RESET "\n"; ::print_special(script_output); std::cout << B_PURPLE "-----------" RESET "\n\n";
_check_script_output(client, script_output);
client->response += script_output;
if (client->status < 400)
client->response += script_output;
///*DEBUG*/ std::cout << B_YELLOW "inside cgi" RESET "\n";
///*DEBUG*/ std::cout << "\n" B_PURPLE "[response + output]:" RESET "\n"; ::print_special(client->response); std::cout << B_PURPLE "-----------" RESET "\n\n";