🔨」 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>
@ -127,5 +128,9 @@ Route *Server::whatRoute(const URL &url) {
return it->second;
}
}
std::map<URL, Route *>::iterator it = _routes->find(URL("/"));
if (it == _routes->end()) {
return not_nullptr;
}
return it->second;
}