🔨」 fix: fixed this shit

This commit is contained in:
adjoly
2025-06-17 19:14:10 +02:00
parent 7ea43723e1
commit 0f9057e16e
11 changed files with 8 additions and 4 deletions

View File

@ -60,7 +60,7 @@ Route::Route(toml::ANode *table) : _max_body(10485760) {
void *val;
bool found;
if (table == not_nullptr) {
if (table == not_nullptr || table->getTable()->empty()) {
_log->warn("is empty");
_index = "index.html";
_redirect = false;
@ -93,6 +93,7 @@ Route::Route(toml::ANode *table) : _max_body(10485760) {
_methods[2] = false;
return;
}
std::cout << "tat me re " << std::endl;
val = accessValue("redirect", toml::STRING, _table, _log);
if (val != not_nullptr) {
_root = *static_cast<std::string *>(val);

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/24 15:10:07 by adjoly #+# #+# */
/* Updated: 2025/06/09 18:40:23 by adjoly ### ########.fr */
/* Updated: 2025/06/17 19:14:04 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -87,6 +87,9 @@ Server::Server(toml::ANode *node)
std::make_pair(URL(it->first), new Route(it->second)));
}
}
if (_routes == not_nullptr || _routes->empty()){
throw std::runtime_error("put a location dumb ass");
}
// delete _table;
}

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/30 09:40:16 by adjoly #+# #+# */
/* Updated: 2025/05/30 16:39:08 by adjoly ### ########.fr */
/* Updated: 2025/06/17 19:07:39 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */