Index and Autoindex work nicely, standarized way paths for root and location path are stored in config, still needs a little polishing prolly

This commit is contained in:
Me
2022-08-08 02:50:37 +02:00
parent cf69168a84
commit 9ee7205b95
13 changed files with 99 additions and 173 deletions

View File

@@ -93,8 +93,6 @@ std::string http_methods_to_str(unsigned int methods)
// you could make this &path...
int path_is_valid(std::string path)
{
// std::string i_path = path.substr(1);
// const char *tmp_path = i_path.c_str();
const char *tmp_path = path.c_str();
struct stat s;
@@ -111,19 +109,6 @@ int path_is_valid(std::string path)
return (1);
}
}
/*
if (stat(tmp_path, &s) == 0 && S_ISREG(s.st_mode)) // a File
{
std::cout << "is a file\n";
return (2);
}
else if (stat(tmp_path, &s) == 0 && S_ISDIR(s.st_mode)) // A Folder
{
std::cout << "is a Dir\n";
return (1);
}
*/
// std::cout << "path is neither dir nor file\n";
return (0);
}