Skip to content

Commit 2649ff9

Browse files
authored
Update wsjcpp_light_web_http_handler_rewrite_folder.cpp
1 parent 01f1955 commit 2649ff9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/wsjcpp_light_web_http_handler_rewrite_folder.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ bool WSJCppLightWebHttpHandlerRewriteFolder::handle(const std::string &sWorkerId
3939
std::string _tag = TAG + "-" + sWorkerId;
4040
std::string sRequestPath = pRequest->getRequestPath();
4141
// WSJCppLog::warn(_tag, pRequest->requestPath());
42+
std::string sRequestPath2 = sRequestPath.substr(m_sPrefixPath.length(), sRequestPath.length() - m_sPrefixPath.length());
43+
std::string sFilePath = m_sWebFolder + sRequestPath2;
4244

43-
std::string sFilePath = m_sWebFolder + sRequestPath;
45+
std::string sFilePath = m_sWebFolder + sRequestPath2;
4446
if (WSJCppCore::fileExists(sFilePath)) {
4547
WSJCppLightWebHttpResponse resp(pRequest->getSockFd());
4648
resp.cacheSec(60).ok().sendFile(sFilePath);
@@ -50,4 +52,4 @@ bool WSJCppLightWebHttpHandlerRewriteFolder::handle(const std::string &sWorkerId
5052
resp.cacheSec(60).ok().sendFile(sFilePath);
5153
}
5254
return true;
53-
}
55+
}

0 commit comments

Comments
 (0)