diff --git a/sample.toml b/sample.toml index 26bbe53..24db8a6 100755 --- a/sample.toml +++ b/sample.toml @@ -3,7 +3,7 @@ port = 5000 host = "0.0.0.0" [server.location./] -root = "/home/adjoly/workspace/42/webserv/exemples/webpage" +root = "/home/adjoly/workspace/42/webserv/exemples" cgi = { ".py"} methods = { "GET", "POST"} -[server.location./] +[server.location./asdf] diff --git a/src/requests_handling/Cgi.cpp b/src/requests_handling/Cgi.cpp index f48bed0..ff30401 100644 --- a/src/requests_handling/Cgi.cpp +++ b/src/requests_handling/Cgi.cpp @@ -6,7 +6,7 @@ /* By: gadelbes +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/24 13:46:34 by gadelbes #+# #+# */ -/* Updated: 2025/05/30 16:13:54 by adjoly ### ########.fr */ +/* Updated: 2025/06/24 18:02:34 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ @@ -186,8 +186,5 @@ std::string Cgi::str(void) { } else break; } - // if (_is_post) - // ResourceManager::remove(_stdin_pipe[PIPE_WRITE]); - // FIX: whyyyyy return str.str(); } diff --git a/src/requests_handling/requestImplementation/Delete.cpp b/src/requests_handling/requestImplementation/Delete.cpp index 312e9a5..c4e6f20 100644 --- a/src/requests_handling/requestImplementation/Delete.cpp +++ b/src/requests_handling/requestImplementation/Delete.cpp @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/30 09:42:18 by adjoly #+# #+# */ -/* Updated: 2025/05/28 11:29:55 by adjoly ### ########.fr */ +/* Updated: 2025/06/24 18:02:42 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ @@ -83,10 +83,6 @@ Response Delete::execute(void) { time_t now = std::time(NULL); response.addHeader("Date", std::string(std::ctime(&now))); } catch (...) { - // TODO: check errno value and get corresponding error page, check for - // corresponding error code : - // https://cdn.discordapp.com/attachments/784779058407014403/1350841524778307586/image.png?ex=67d8dd74&is=67d78bf4&hm=c030468d3862627d6402bf200960d1a15249ba2f8dac772af3283b368a77f2f5& - response.setProtocol(this->_protocol); response.setStatusCode(404); response.addHeader("Content-Type", "text/html"); diff --git a/src/requests_handling/requestImplementation/Get.cpp b/src/requests_handling/requestImplementation/Get.cpp index c7c0ee5..266fda3 100644 --- a/src/requests_handling/requestImplementation/Get.cpp +++ b/src/requests_handling/requestImplementation/Get.cpp @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/30 09:40:16 by adjoly #+# #+# */ -/* Updated: 2025/06/23 21:26:10 by adjoly ### ########.fr */ +/* Updated: 2025/06/24 18:02:19 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ @@ -264,7 +264,6 @@ body {\n\ http::Mime::getType(this->_target)); } } catch (...) { - // TODO: replace with a predefined array of error pages response.setProtocol(this->_protocol); response.setStatusCode(404); response.addHeader("Content-Type", "text/html"); diff --git a/src/server/ServerHandle.cpp b/src/server/ServerHandle.cpp index 1f9261c..f4e32bb 100644 --- a/src/server/ServerHandle.cpp +++ b/src/server/ServerHandle.cpp @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/05/27 18:22:48 by adjoly #+# #+# */ -/* Updated: 2025/06/23 21:25:17 by adjoly ### ########.fr */ +/* Updated: 2025/06/24 18:02:10 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ @@ -126,10 +126,8 @@ void Server::_handle_client(size_t *i) { void Server::_handle_resource(size_t i) { struct pollfd pfd = PfdManager::at(i); AClientResource *res = ResourceManager::get(pfd.fd); - if (res == not_nullptr) { - std::cout << "wtff" << std::endl; + if (res == not_nullptr) return; - } if (!res->isProcessed() && res->isReady()) { res->process();