From 961b25d09fbb7a822969bbca050bb4d5a0c81f61 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Wed, 20 Nov 2019 14:19:55 +0100 Subject: [PATCH] Hopefully bugfix --- src/URI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/URI.cpp b/src/URI.cpp index 8fd41e7..9ff361e 100644 --- a/src/URI.cpp +++ b/src/URI.cpp @@ -67,7 +67,7 @@ URI::URI(string webroot, string reqpath) { && (!fileExists(webroot + relpath + ".php") || (isDirectory(webroot + relpath + ".php") && !fileExists(webroot + relpath + ".php/index.php"))) && (!fileExists(webroot + relpath + ".html") || (isDirectory(webroot + relpath + ".html") && !fileExists(webroot + relpath + ".html/index.php")))) { long slash = relpath.find_last_of('/'); - if (slash == string::npos) { + if (slash == string::npos || relpath == "/") { break; } info = relpath.substr(slash) + info;