client variables are const ref
This commit is contained in:
@@ -147,13 +147,8 @@ void Webserv::_get(Client *client, ServerConfig &server, LocationConfig &locatio
|
||||
//
|
||||
if (_is_cgi(client))
|
||||
{
|
||||
// DEBUG
|
||||
std::cout << "\nSCRIPT PATH _________________"
|
||||
<< "\npath:" << client->get_rq_script_path()
|
||||
<< "\npath_info:" << client->get_rq_script_info()
|
||||
<< "\n\n";
|
||||
|
||||
_exec_cgi(client);
|
||||
_response_correction(client);
|
||||
return;
|
||||
}
|
||||
//
|
||||
@@ -229,6 +224,24 @@ void Webserv::_get_file(Client *client, const std::string &path)
|
||||
}
|
||||
}
|
||||
|
||||
// WIP HUGO
|
||||
void Webserv::_response_correction(Client *client)
|
||||
{
|
||||
// TODO : change all the '\n' by '\r\n'
|
||||
// TODO : there is at least one header field followed by '\r\n\r\n' :
|
||||
// - "Content-Type"
|
||||
// - "Location"
|
||||
// - "Status"
|
||||
// TODO : there is no field duplicate (resolve conflicts)
|
||||
// TODO : there is no space between filed name and ":"
|
||||
// TODO : if no Location field && no Status field -> status code = 200
|
||||
// TODO?: handle Location field, either :
|
||||
// - local : start with '/' --> rerun the request with new uri
|
||||
// - client : start with '<scheme>:' --> send back status code 302
|
||||
|
||||
(void)client;
|
||||
}
|
||||
|
||||
void Webserv::_append_body(Client *client, const char *body, size_t body_size, const std::string &file_extension)
|
||||
{
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user