wip test path cgi :

- _cgi_pos seems to be ok
  - construct url from return is not implemented yet
+ renamed script with extension .php and .cpp
This commit is contained in:
hugogogo
2022-08-12 23:31:59 +02:00
parent c7bbf29a1b
commit f17bc9fa58
7 changed files with 45 additions and 18 deletions

View File

@@ -71,15 +71,18 @@ void Webserv::_construct_response(Client *client)
{
std::string path = _replace_url_root(client, client->get_rq_abs_path());
/* size_t pos = _cgi_pos(client, path);
if (pos != NPOS)
{
client->fill_script_path(path, pos);
std::string script_output = _exec_cgi(client);
_check_script_output(client, script_output);
client->response += script_output;
return;
} */
size_t pos = _cgi_pos(client, path);
//debug
std::cout << "pos:" << pos << B_YELLOW << "\nfin debug _cgi_pos()\n\n" << RESET;
(void)pos;
// if (pos != NPOS)
// {
// client->fill_script_path(path, pos);
// std::string script_output = _exec_cgi(client);
// _check_script_output(client, script_output);
// client->response += script_output;
// return;
// }
_process_method(client, path);
}