Skip to content

Commit 9d534b2

Browse files
committed
Fixed HTML directory listing of subdirectories
1 parent 630c414 commit 9d534b2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ResourceHost.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ Resource* ResourceHost::readDirectory(std::string path, struct stat sb) {
144144
*/
145145
std::string ResourceHost::generateDirList(std::string path) {
146146
// Get just the relative uri from the entire path by stripping out the baseDiskPath from the beginning
147-
size_t uri_pos = path.find_last_of(baseDiskPath);
147+
size_t uri_pos = path.find(baseDiskPath);
148148
std::string uri = "?";
149149
if (uri_pos != std::string::npos)
150-
uri = path.substr(uri_pos);
150+
uri = path.substr(baseDiskPath.length());
151151

152152
std::stringstream ret;
153153
ret << "<html><head><title>" << uri << "</title></head><body>";

0 commit comments

Comments
 (0)