🔨」 fix: fixed whatRoute

This commit is contained in:
2025-04-30 15:38:51 +02:00
parent 98955fc131
commit 0a7cb599bf

View File

@ -6,10 +6,11 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/24 15:10:07 by adjoly #+# #+# */
/* Updated: 2025/04/22 15:36:30 by adjoly ### ########.fr */
/* Updated: 2025/04/30 15:37:18 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "config/URL.hpp"
#include "cppeleven.hpp"
#include <config/default.hpp>
#include <webserv.hpp>
@ -79,7 +80,7 @@ Server::Server(toml::ANode *node) : _table(node) {
(*_routes)[URL(it->first)] = new Route(it->second);
}
}
//delete _table;
// delete _table;
}
Server::~Server(void) {
@ -127,5 +128,9 @@ Route *Server::whatRoute(const URL &url) {
return it->second;
}
}
return not_nullptr;
std::map<URL, Route *>::iterator it = _routes->find(URL("/"));
if (it == _routes->end()) {
return not_nullptr;
}
return it->second;
}