Merge branch 'hugo3'

+ script output verification works (field duplicate and status)
+ parsing_message_http :
  - the file is deleted
  - of the three functions it contained, only one still exist
  - 'parse_http_headers' is now in utils
+ changes in utils :
  - http headers parsing doesn't change key case itself
  - a new function change key case tolower case in map<str, str>
  - added split_trim() that perform a split and a trim at once
  - resolved pbm in trim
  - added print_special to print special char '\r' and '\n'
  - del_line became extract_line, because it returns the deleted line
  - added get line, that does the same without deleting
  - moved http_header in utils, and made it more consistent
+ in Client :
  - parse_request is now named parse_request_headers to work with parse body
  - private function _parse_request_headers is then now _parse_request_fields
    (because it doesn't take care of request first line, but only fields)
  - added a debug function 'print_client'
This commit is contained in:
hugogogo
2022-08-12 14:05:11 +02:00
19 changed files with 374 additions and 184 deletions

View File

@@ -18,9 +18,6 @@ void Webserv::_get(Client *client)
if (_is_cgi(client))
{
script_output = _exec_cgi(client);
// DEBUG
std::cout << "\n____script_output____\n" << script_output << "\n_______________\n";
// wip check output of script
_check_script_output(client, script_output);
client->response += script_output;
return;
@@ -48,8 +45,6 @@ void Webserv::_get(Client *client)
}
else
_get_file(client, path);
}
# define MAX_FILESIZE 1000000 // (1Mo)