summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--config.cpp7
-rw-r--r--webserver.conf2
2 files changed, 6 insertions, 3 deletions
diff --git a/config.cpp b/config.cpp
index 6dbd8ee..baf611b 100644
--- a/config.cpp
+++ b/config.cpp
@@ -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;
}
diff --git a/webserver.conf b/webserver.conf
index 7749739..c41e7b2 100644
--- a/webserver.conf
+++ b/webserver.conf
@@ -6,7 +6,7 @@
<plugin-directory><a c="d">b<e>f</e></a>/usr/lib/webserver/plugins</plugin-directory>
<plugin-directory>/usr/local/lib/webserver/plugins</plugin-directory>
-->
- <plugin-directory>plugins</plugin-directory>
+ <plugin-directory>plugins-examples</plugin-directory>
<sites>
<site>
<name>antcom.de</name>