mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-07-16 02:36:32 +02:00
「🔨」 fix: fixed delete
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/04/30 09:30:15 by adjoly #+# #+# */
|
/* Created: 2025/04/30 09:30:15 by adjoly #+# #+# */
|
||||||
/* Updated: 2025/05/30 16:19:06 by adjoly ### ########.fr */
|
/* Updated: 2025/07/08 11:42:46 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -59,6 +59,7 @@ class Delete : public ARequest {
|
|||||||
public:
|
public:
|
||||||
Delete(void) {}
|
Delete(void) {}
|
||||||
Delete(std::string &data, config::Server *srv);
|
Delete(std::string &data, config::Server *srv);
|
||||||
|
~Delete();
|
||||||
|
|
||||||
void parse(std::string const &data);
|
void parse(std::string const &data);
|
||||||
|
|
||||||
|
@ -4,5 +4,5 @@ port = 2727
|
|||||||
|
|
||||||
[server.location./]
|
[server.location./]
|
||||||
root = "./exemples/webpage"
|
root = "./exemples/webpage"
|
||||||
methods = { "GET", "POST" }
|
methods = { "GET", "POST", "DELETE" }
|
||||||
cgi = { ".py"}
|
cgi = { ".py"}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/04/30 09:42:18 by adjoly #+# #+# */
|
/* Created: 2025/04/30 09:42:18 by adjoly #+# #+# */
|
||||||
/* Updated: 2025/07/07 19:06:38 by mmoussou ### ########.fr */
|
/* Updated: 2025/07/08 11:43:21 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -46,6 +46,8 @@ void Delete::parse(std::string const &data) {
|
|||||||
this->_headers.insert(std::make_pair(key, _sanitizeStr(value)));
|
this->_headers.insert(std::make_pair(key, _sanitizeStr(value)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_route = _srv->whatRoute(URL(_target));
|
||||||
|
|
||||||
std::ostringstream body_stream;
|
std::ostringstream body_stream;
|
||||||
while (std::getline(stream, line))
|
while (std::getline(stream, line))
|
||||||
@ -69,6 +71,11 @@ void Delete::parse(std::string const &data) {
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Delete::~Delete(void) {
|
||||||
|
if (_url != not_nullptr)
|
||||||
|
delete _url;
|
||||||
|
}
|
||||||
|
|
||||||
Response Delete::execute(void) {
|
Response Delete::execute(void) {
|
||||||
http::Response response;
|
http::Response response;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user