🔨」 fix: fixed things

This commit is contained in:
y-syo
2025-07-12 18:01:43 +02:00
parent 4ca633d50e
commit e202b9cd77
3 changed files with 13 additions and 11 deletions

View File

@ -6,7 +6,7 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/17 11:12:41 by mmoussou #+# #+# */
/* Updated: 2025/07/12 13:44:56 by adjoly ### ########.fr */
/* Updated: 2025/07/12 17:51:43 by mmoussou ### ########.fr */
/* */
/* ************************************************************************** */
@ -90,6 +90,7 @@ void Client::parse(void)
_log->error("failed to receive request");
throw std::runtime_error("failed to receive request");
}
size_t tmp_size = received_data.length();
_getRequest(received_data);
if (_request == not_nullptr)
@ -117,8 +118,8 @@ void Client::parse(void)
(_request->getMethod() == "DELETE" && !_route->getMethods()[2]))
this->_request->setMethod("405");
// if (received_data.length() > (unsigned long)(_route->getMaxBody()))
// this->_request->setMethod("413");
if (tmp_size > (unsigned long)(_route->getMaxBody()))
this->_request->setMethod("413");
}
bool Client::requestParsed(void) {