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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user