mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-06-25 09:33:36 +02:00
「🔨」 fix: fixed some things.
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/03/19 14:59:41 by adjoly #+# #+# */
|
/* Created: 2025/03/19 14:59:41 by adjoly #+# #+# */
|
||||||
/* Updated: 2025/06/09 18:35:35 by adjoly ### ########.fr */
|
/* Updated: 2025/06/23 21:03:07 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -39,6 +39,8 @@ class Route {
|
|||||||
std::vector<std::string> *getCgi(void) { return _cgi; }
|
std::vector<std::string> *getCgi(void) { return _cgi; }
|
||||||
bool * getMethods(void) { return _methods; }
|
bool * getMethods(void) { return _methods; }
|
||||||
bool isCgi(std::string target) {
|
bool isCgi(std::string target) {
|
||||||
|
if (target.find('.') == target.npos)
|
||||||
|
return false;
|
||||||
std::string target_ext = target.substr(target.find('.'));
|
std::string target_ext = target.substr(target.find('.'));
|
||||||
if (_cgi == not_nullptr)
|
if (_cgi == not_nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
4
sample.toml
Normal file → Executable file
4
sample.toml
Normal file → Executable file
@ -1,6 +1,6 @@
|
|||||||
[server]
|
[server]
|
||||||
|
port = 5000
|
||||||
host = "0.0.0.0"
|
host = "0.0.0.0"
|
||||||
port = 8090
|
|
||||||
|
|
||||||
[server.location./]
|
[server.location./]
|
||||||
methods = {"GET"
|
root = "/home/adjoly/workspace/42/webserv/exemples/"
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/04/30 09:40:16 by adjoly #+# #+# */
|
/* Created: 2025/04/30 09:40:16 by adjoly #+# #+# */
|
||||||
/* Updated: 2025/06/17 19:07:39 by adjoly ### ########.fr */
|
/* Updated: 2025/06/23 21:03:12 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ Get::Get(std::string &data, config::Server *srv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Get::~Get(void) {
|
Get::~Get(void) {
|
||||||
if (_url != not_nullptr)
|
if (_url != not_nullptr)
|
||||||
delete _url;
|
delete _url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/04/17 11:12:41 by mmoussou #+# #+# */
|
/* Created: 2025/04/17 11:12:41 by mmoussou #+# #+# */
|
||||||
/* Updated: 2025/05/28 11:30:11 by adjoly ### ########.fr */
|
/* Updated: 2025/06/23 21:03:10 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -48,7 +48,6 @@ void Client::parse(void) {
|
|||||||
}
|
}
|
||||||
received_data += std::string(buffer, bytes_received);
|
received_data += std::string(buffer, bytes_received);
|
||||||
} while (buffer[bytes_received]);
|
} while (buffer[bytes_received]);
|
||||||
|
|
||||||
_getRequest(received_data);
|
_getRequest(received_data);
|
||||||
|
|
||||||
if (_request == not_nullptr)
|
if (_request == not_nullptr)
|
||||||
@ -65,6 +64,7 @@ void Client::parse(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!_route || _route == not_nullptr) {
|
if (!_route || _route == not_nullptr) {
|
||||||
_request->setMethod("404");
|
_request->setMethod("404");
|
||||||
return;
|
return;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/05/27 18:22:48 by adjoly #+# #+# */
|
/* Created: 2025/05/27 18:22:48 by adjoly #+# #+# */
|
||||||
/* Updated: 2025/05/30 16:30:40 by adjoly ### ########.fr */
|
/* Updated: 2025/06/23 20:55:13 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user