From 457e05e8e5a44aa44eafb5d9bd6ff763f0e49a64 Mon Sep 17 00:00:00 2001 From: adjoly Date: Mon, 23 Jun 2025 21:23:37 +0200 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=F0=9F=94=A8=E3=80=8D=20fix:=20fixed?= =?UTF-8?q?=20some=20things.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exemples/webpage/post_cgi.py | 2 +- lib/tomlpp | 2 +- sample.toml | 4 +++- src/requests_handling/requestImplementation/Get.cpp | 3 ++- src/requests_handling/requestImplementation/Post.cpp | 2 +- src/server/Client.cpp | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/exemples/webpage/post_cgi.py b/exemples/webpage/post_cgi.py index e8b3c24..631d5c9 100755 --- a/exemples/webpage/post_cgi.py +++ b/exemples/webpage/post_cgi.py @@ -1,4 +1,4 @@ -#!/nix/store/kjvgj2n3yn70hmjifg6y0bk9m4rf7jba-python3-3.12.10/bin/python3 +#!/nix/store/8w718rm43x7z73xhw9d6vh8s4snrq67h-python3-3.12.10/bin/python3 import cgi import cgitb diff --git a/lib/tomlpp b/lib/tomlpp index 9f3aa94..a3af54e 160000 --- a/lib/tomlpp +++ b/lib/tomlpp @@ -1 +1 @@ -Subproject commit 9f3aa94aeb7fbe54518d7431c5ec35e66ecc7741 +Subproject commit a3af54e7919fbeaf2c8b0e78a1ad187884edd752 diff --git a/sample.toml b/sample.toml index 919dd27..e576120 100755 --- a/sample.toml +++ b/sample.toml @@ -3,4 +3,6 @@ port = 5000 host = "0.0.0.0" [server.location./] -root = "/home/adjoly/workspace/42/webserv/exemples/" +root = "/home/adjoly/workspace/42/webserv/exemples/webpage" +cgi = { ".py"} +methods = { "GET", "POST"} diff --git a/src/requests_handling/requestImplementation/Get.cpp b/src/requests_handling/requestImplementation/Get.cpp index 50cb274..59d243e 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:03:12 by adjoly ### ########.fr */ +/* Updated: 2025/06/23 21:16:06 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ @@ -149,6 +149,7 @@ Response Get::execute(void) { } std::string str = static_cast(_cgi)->str(); response = parseCgiOut(str); + std::cout << response.str(); response.setProtocol(_protocol); server::PfdManager::remove(_cgi->getId()); server::ResourceManager::remove(_cgi->getId()); diff --git a/src/requests_handling/requestImplementation/Post.cpp b/src/requests_handling/requestImplementation/Post.cpp index 5696d1d..72cbd79 100644 --- a/src/requests_handling/requestImplementation/Post.cpp +++ b/src/requests_handling/requestImplementation/Post.cpp @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/30 09:50:20 by adjoly #+# #+# */ -/* Updated: 2025/05/30 16:19:33 by adjoly ### ########.fr */ +/* Updated: 2025/06/23 21:21:10 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/src/server/Client.cpp b/src/server/Client.cpp index b3b0db8..9e742bb 100644 --- a/src/server/Client.cpp +++ b/src/server/Client.cpp @@ -6,7 +6,7 @@ /* By: mmoussou