Skip to content

Commit fa65247

Browse files
author
Soufiane Nouae
committed
fin
2 parents 5ef0fb5 + acb29d6 commit fa65247

File tree

4 files changed

+12
-31
lines changed

4 files changed

+12
-31
lines changed

config/server.conf

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
server
22
{
3-
listen 8002;
3+
listen 8001;
44

55
host 127.0.0.1;
66
client_max_body_size 100;
7-
server_name hhjdsghj dsfsdfda dfdsfsdf;
7+
88

99
error_page 404 www/html/error_pages/404.html;
1010
error_page 403 www/html/error_pages/403.html;
@@ -14,16 +14,17 @@ server
1414
error_page 413 www/html/error_pages/413.html;
1515
error_page 500 www/html/error_pages/500.html;
1616

17-
index index.html;
17+
# index index.html;
1818

1919
location / {
20-
autoindex off;
20+
autoindex on;
2121
}
2222

2323
location /cgi_bin
2424
{
2525
root ./www/html/cgi_bin;
2626
allow_Methods GET;
27+
2728
allow_Methods POST;
2829
#index hello.html;
2930
path_info .py /usr/bin/python3;

respond/method_handling.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: aoumad <[email protected]> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2023/04/09 17:52:50 by aoumad #+# #+# */
9-
/* Updated: 2023/05/23 20:21:54 by aoumad ### ########.fr */
9+
/* Updated: 2023/05/24 12:16:06 by aoumad ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -75,6 +75,8 @@ void Respond::handle_post_response(std::vector<server> server)
7575
if (_is_cgi == true)
7676
{
7777
run_cgi(r, *this, server);
78+
set_status_code(201);
79+
set_status_message(get_response_status(201));
7880
return ;
7981
}
8082
else
@@ -85,13 +87,17 @@ void Respond::handle_post_response(std::vector<server> server)
8587
std::string::size_type i = r.get_uri().find_last_of('/');
8688
if (i != std::string::npos)
8789
path = r.get_uri().substr(i);
90+
set_status_code(201);
91+
set_status_message(get_response_status(201));
8892
init_response_body(server, path, server[_server_index]._location[_location_index].get_root());
8993
return ;
9094
}
9195
}
9296
if (check_post_type() == "form-data")
9397
{
9498
handle_form_data(server);
99+
set_status_code(201);
100+
set_status_message(get_response_status(201));
95101
return ;
96102
}
97103
}
Binary file not shown.

www/html/upload/getfile.php

-26
This file was deleted.

0 commit comments

Comments
 (0)