diff options
Diffstat (limited to 'config.cpp')
-rw-r--r-- | config.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -189,6 +189,7 @@ std::string Config::DocRoot(const Socket& socket, const std::string& requested_h { // TODO: speed this up std::string host{requested_host}; + std::string result; auto pos {host.find(':')}; if (pos != host.npos) { @@ -201,7 +202,9 @@ std::string Config::DocRoot(const Socket& socket, const std::string& requested_h if (m_host == host) { for (const auto& path: site.paths) { if (boost::starts_with(requested_path, path.requested)) { - return path.params.at("target"); + const auto& root { path.params.at("target")}; + if (root.size() > result.size()) + result = root; } } } @@ -209,6 +212,6 @@ std::string Config::DocRoot(const Socket& socket, const std::string& requested_h } } - return ""; + return result; } |