mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-05-10 20:48:46 +02:00
「🔨」 fix: fixed whatRoute
This commit is contained in:
@ -6,10 +6,11 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/03/24 15:10:07 by adjoly #+# #+# */
|
/* 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 "cppeleven.hpp"
|
||||||
#include <config/default.hpp>
|
#include <config/default.hpp>
|
||||||
#include <webserv.hpp>
|
#include <webserv.hpp>
|
||||||
@ -79,7 +80,7 @@ Server::Server(toml::ANode *node) : _table(node) {
|
|||||||
(*_routes)[URL(it->first)] = new Route(it->second);
|
(*_routes)[URL(it->first)] = new Route(it->second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//delete _table;
|
// delete _table;
|
||||||
}
|
}
|
||||||
|
|
||||||
Server::~Server(void) {
|
Server::~Server(void) {
|
||||||
@ -127,5 +128,9 @@ Route *Server::whatRoute(const URL &url) {
|
|||||||
return it->second;
|
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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user