still working on telnet tester
This commit is contained in:
@@ -46,6 +46,18 @@ void ConfigParser::_post_processing(std::vector<ServerConfig> *servers)
|
||||
|
||||
while (it_l != it->locations.end())
|
||||
{
|
||||
if (it_l->path[it_l->path.size() - 1] == '/'
|
||||
&& it_l->path.size() > 1)
|
||||
it_l->path.erase(it_l->path.size() - 1);
|
||||
|
||||
std::vector<LocationConfig>::const_iterator tmp = it_l + 1;
|
||||
while (tmp != it->locations.end())
|
||||
{
|
||||
if (it_l->path == tmp->path)
|
||||
throw std::invalid_argument("Duplicate locations in config file");
|
||||
++tmp;
|
||||
}
|
||||
|
||||
if (it_l->root == "")
|
||||
it_l->root = it->root;
|
||||
|
||||
@@ -57,13 +69,6 @@ void ConfigParser::_post_processing(std::vector<ServerConfig> *servers)
|
||||
|
||||
// nothing to be done for cgi_ext, error_pages, redirect
|
||||
|
||||
// if (eval_file_type(it_l->root) == IS_DIR
|
||||
// && it_l->path[it_l->path.size() - 1] != '/')
|
||||
// it_l->path.push_back('/');
|
||||
if (it_l->path[it_l->path.size() - 1] == '/'
|
||||
&& it_l->path.size() > 1)
|
||||
it_l->path.erase(it_l->path.size() - 1);
|
||||
|
||||
++it_l;
|
||||
}
|
||||
std::sort(it->locations.begin(), it->locations.end());
|
||||
|
||||
Reference in New Issue
Block a user