Merge remote-tracking branch 'origin/fara' into roman

This commit is contained in:
3lswear
2022-02-27 18:15:43 +03:00
108 changed files with 3782 additions and 11 deletions

View File

@@ -279,7 +279,7 @@ std::string Response::getFullURI(void)
_upload_dir = _location->uploadDir + tmp;
tmp = _location->root + tmp;
}
if (_request.isDir(tmp) == 0)
if (_request.isDir(tmp) == 0 && _request.getURI() == _location->location)
{
if (_location->directoryFile.empty() || _Autoindex)
ret = tmp;
@@ -292,6 +292,7 @@ std::string Response::getFullURI(void)
ret = tmp;
if (_upload_dir.empty())
_upload_dir = ret;
DBOUT << WARNING << getDebugTime() << OKCYAN << " [fullURI: " << ret << " ]" << ENDL;
return (ret);
}

View File

@@ -419,8 +419,8 @@ bool ServerConfig::checkFileAndDir(location *loc)
if (!root.empty())
{
if (isDir(root) != 0)
throw ConfigException("Directory " + root + " not found!");
if (isDir(root) != 0 && isFile(root) != 0)
throw ConfigException("File or directory " + root + " not found!");
}
if (!upload_dir.empty())
{