[Download] Changed registered endpoint to /file/
This commit is contained in:
parent
65fcc95480
commit
cb2162a0d0
@ -414,12 +414,6 @@ namespace Components
|
|||||||
std::string url(message->uri.p, message->uri.len);
|
std::string url(message->uri.p, message->uri.len);
|
||||||
Utils::String::Replace(url, "\\", "/");
|
Utils::String::Replace(url, "\\", "/");
|
||||||
|
|
||||||
if (url.length() < 6)
|
|
||||||
{
|
|
||||||
Download::Forbid(nc);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
url = url.substr(6);
|
url = url.substr(6);
|
||||||
|
|
||||||
Utils::String::Replace(url, "%20", " ");
|
Utils::String::Replace(url, "%20", " ");
|
||||||
@ -609,7 +603,7 @@ namespace Components
|
|||||||
// Handle special requests
|
// Handle special requests
|
||||||
mg_register_http_endpoint(nc, "/info", Download::InfoHandler);
|
mg_register_http_endpoint(nc, "/info", Download::InfoHandler);
|
||||||
mg_register_http_endpoint(nc, "/list", Download::ListHandler);
|
mg_register_http_endpoint(nc, "/list", Download::ListHandler);
|
||||||
mg_register_http_endpoint(nc, "/file", Download::FileHandler);
|
mg_register_http_endpoint(nc, "/file/", Download::FileHandler);
|
||||||
|
|
||||||
mg_set_protocol_http_websocket(nc);
|
mg_set_protocol_http_websocket(nc);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user