fix(URI): trim URI before extracting substring for improved path handling

This commit is contained in:
whaffman 2025-10-20 17:56:56 +02:00
parent 8dc20a5715
commit eedb5382ea

View File

@ -60,7 +60,9 @@ void URI::parseUri(const std::string &uri)
{
auto const *locConfig = dynamic_cast<LocationConfig const *>(config_);
std::string locTrimmed = utils::trim(locConfig->getPath(), "/");
std::string uriSub = uri.substr(locTrimmed.length());
std::string uriTrimmed = utils::trim(uri, "/");
std::string uriSub = uriTrimmed.substr(locTrimmed.length());
fullPath_ = FileUtils::joinPath(locConfig->get<std::string>("root").value_or(""), uriSub);
}