fix: update parseFullpath to set baseName on invalid path segment and add debug log for CGI check
This commit is contained in:
parent
4687b40fc2
commit
6263fe3dd5
@ -106,7 +106,6 @@ void URI::parseUri()
|
|||||||
void URI::parseFullpath()
|
void URI::parseFullpath()
|
||||||
{
|
{
|
||||||
auto uriSegments = utils::split(fullPath_, '/');
|
auto uriSegments = utils::split(fullPath_, '/');
|
||||||
|
|
||||||
for (const auto &segment : uriSegments)
|
for (const auto &segment : uriSegments)
|
||||||
{
|
{
|
||||||
std::string currentPath = FileUtils::joinPath(dir_, segment);
|
std::string currentPath = FileUtils::joinPath(dir_, segment);
|
||||||
@ -135,6 +134,7 @@ void URI::parseFullpath()
|
|||||||
else // not file or dir, and no baseName yet
|
else // not file or dir, and no baseName yet
|
||||||
{
|
{
|
||||||
valid_ = false;
|
valid_ = false;
|
||||||
|
baseName_ = segment; // TODO: is this correct? works for tester but seems odd
|
||||||
Log::warning("Invalid path segment encountered: " + currentPath);
|
Log::warning("Invalid path segment encountered: " + currentPath);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -177,6 +177,7 @@ bool URI::isValid() const noexcept
|
|||||||
|
|
||||||
bool URI::isCgi() const noexcept
|
bool URI::isCgi() const noexcept
|
||||||
{
|
{
|
||||||
|
Log::debug("Check for CGI extension: " + getExtension() + ", with basename " + baseName_);
|
||||||
return config_->isCGI(getExtension());
|
return config_->isCGI(getExtension());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user