is_cgi function is back and is working
+ in utils added function eval_file_mode(), it returns http errors codes about file
This commit is contained in:
@@ -67,17 +67,15 @@ void Webserv::_append_base_headers(Client *client)
|
||||
client->response.append("Connection: keep-alive" CRLF);
|
||||
}
|
||||
|
||||
// TODO HUGO : wip
|
||||
void Webserv::_construct_response(Client *client)
|
||||
{
|
||||
std::string path;
|
||||
std::string script_output;
|
||||
|
||||
path = _replace_url_root(client, client->get_rq_abs_path());
|
||||
size_t pos = _cgi_pos(client, path); /*DEBUG*/ std::cout << "pos:" << pos << "\n&path[pos]:" << &path[pos] << "\n" << B_YELLOW << "fin debug _cgi_pos()\n\n" << RESET;
|
||||
|
||||
if (pos != NPOS)
|
||||
if (_is_cgi(client, path))
|
||||
{
|
||||
client->fill_script_path(path, pos);
|
||||
script_output = _exec_cgi(client);
|
||||
_check_script_output(client, script_output);
|
||||
client->response += script_output;
|
||||
|
||||
Reference in New Issue
Block a user