diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-05-08 17:31:07 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-05-08 17:31:07 +0200 |
commit | bc950407cb37e19d833dd9900137be41f7af4d03 (patch) | |
tree | af2c5f6bb468f45a4b961e723bd6eb3bf5aefbc5 /config.cpp | |
parent | 17bb15014cf344bb24e0576b70cf535e89eb5b54 (diff) |
Bugfix: Path matching
Diffstat (limited to 'config.cpp')
-rw-r--r-- | config.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -256,7 +256,10 @@ const Path& Config::GetPath(const Socket& socket, const std::string& requested_h for (const auto& m_host: site.hosts) { if (m_host == host) { for (const auto& path: site.paths) { - if (boost::starts_with(requested_path, path.requested) && path.requested.size() > path_len) { + if (boost::starts_with(requested_path, path.requested) && + "/&\0"s.find(requested_path[path.requested.size()]) != std::string::npos && + path.requested.size() > path_len) + { path_len = path.requested.size(); result = &path; } |