Merge branch 'hugo2'

+ changed the appropriate getters for client
+ moved the functions to parse the http message
  (first line, headers, and body)
  outside client, in parsing_http_message.cpp
+ resolved some of the throw problems
This commit is contained in:
hugogogo
2022-08-09 15:54:40 +02:00
24 changed files with 205391 additions and 214 deletions

View File

@@ -8,7 +8,7 @@ void Webserv::_post(Client *client)
WIP
https://www.rfc-editor.org/rfc/rfc9110.html#name-post
*/
std::string path = client->get_path();
std::string path = client->get_rq_abs_path();
path.insert(0, client->assigned_location->root);
/* CGI Here ? */
@@ -46,7 +46,7 @@ void Webserv::_post_file(Client *client, const std::string &path)
// Maybe usefull in _read_request() for rejecting too big content.
// Need to _determine_process_server() as soon as possible,
// like in _read_request() for stopping read if body is too big ?
ofd << client->get_body();
ofd << client->get_rq_body();
if (!ofd)
{
std::cerr << path << ": ofd.write fail" << '\n';