diff --git a/src/Http/HttpSession.cpp b/src/Http/HttpSession.cpp index 10d6b08d..a6ccb2b9 100644 --- a/src/Http/HttpSession.cpp +++ b/src/Http/HttpSession.cpp @@ -433,8 +433,9 @@ static string findIndexFile(const string &dir){ while ((pDirent = readdir(pDir)) != NULL) { static set indexSet = {"index.html","index.htm","index"}; if(indexSet.find(pDirent->d_name) != indexSet.end()){ + string ret = pDirent->d_name; closedir(pDir); - return pDirent->d_name; + return ret; } } closedir(pDir);