location picker works, needs to be tested more tho

This commit is contained in:
Me
2022-08-10 01:59:10 +02:00
parent 1eb989a3fd
commit 8e90221058
8 changed files with 141 additions and 68 deletions

View File

@@ -55,26 +55,16 @@ void ConfigParser::_post_processing(std::vector<ServerConfig> *servers)
if (it_l->index.empty())
it_l->index = it->index;
// same for redirect status i think
// nothing to be done for cgi_ext, error_pages, redirect
// maybe do something for Cgi_ext?
// std::cout << "In Post, Root + Path: " << it_l->root + it_l->path << '\n';
/* if (path_is_valid(it_l->root + it_l->path) == 0)
{
//either we throw or we erase
throw std::invalid_argument("location path is invalid");
}
*/
if (path_is_valid(it_l->root + it_l->path) == 1 \
&& it_l->path[it_l->path.size() - 1] != '/')
it_l->path.push_back('/');
++it_l;
}
std::sort(it->locations.begin(), it->locations.end());
// std::reverse(it->locations.begin(), it->locations.end());
std::reverse(it->locations.begin(), it->locations.end());
++it;
}