diff options
Diffstat (limited to 'main.cc')
-rw-r--r-- | main.cc | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -153,14 +153,14 @@ int main(int argc, char **argv) { boost::filesystem::path path = web_root_path; path /= request->getPath(); + if (path.extension().string() == ".mpd") { + response->setResponseLifetime(std::chrono::milliseconds(1000)); + } + if (boost::filesystem::exists(path)) { path = boost::filesystem::canonical(path); - if (path.extension().string() == ".mpd") { - response->setResponseLifetime(std::chrono::milliseconds(1000)); - } - //Check if path is within web_root_path if (distance(web_root_path.begin(), web_root_path.end()) <= distance(path.begin(), path.end()) && equal(web_root_path.begin(), web_root_path.end(), path.begin())) { |