mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-20 14:32:47 +00:00
fixed build error
This commit is contained in:
@@ -905,16 +905,17 @@ namespace torrents
|
||||
|
||||
void TorrentsRPCSession::HandleWeb (const boost::beast::http::request<boost::beast::http::string_body>& req)
|
||||
{
|
||||
LogPrint (eLogDebug, "TorrentsRPC: target ", req.target ());
|
||||
std::string contentType ("text/html");
|
||||
auto filePath = std::filesystem::path (i2p::fs::GetDataDir ()) / "torrents" / "web";
|
||||
if (req.target ().empty () || req.target ().back() == '/')
|
||||
std::string target {req.target ()};
|
||||
if (target.empty () || target.back() == '/')
|
||||
filePath /= "index.html";
|
||||
else
|
||||
{
|
||||
std::filesystem::path urlPath (req.target ());
|
||||
|
||||
std::filesystem::path urlPath (target);
|
||||
filePath /= urlPath.filename ();
|
||||
if (urlPath.extension () == "js")
|
||||
if (urlPath.extension () == ".js")
|
||||
contentType = "application/javascript";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user