diff options
| author | Roland Reichwein <mail@reichwein.it> | 2020-05-08 20:02:54 +0200 | 
|---|---|---|
| committer | Roland Reichwein <mail@reichwein.it> | 2020-05-08 20:02:54 +0200 | 
| commit | 474887f30d442b6f18ec9e8f3335cc73fee6551d (patch) | |
| tree | 88806f32ac15d448be704aa93f499f8e39aeadb8 | |
| parent | 905abe4f233d23a567b0d36bd1d25e86bc949e60 (diff) | |
Fix path matching
| -rw-r--r-- | config.cpp | 5 | 
1 files changed, 4 insertions, 1 deletions
@@ -257,7 +257,10 @@ const Path& Config::GetPath(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) && -          "/?\0"s.find(requested_path[path.requested.size()]) != std::string::npos && +          ("/?"s.find(requested_path[path.requested.size()]) != std::string::npos || +           requested_path[path.requested.size()] == 0 || +           requested_path[path.requested.size() - 1] == '/' +          ) &&            path.requested.size() > path_len)        {         path_len = path.requested.size();  | 
