18 lines
344 B
C++
18 lines
344 B
C++
|
#include "StaticFileHandler.H"
|
||
|
|
||
|
std::string
|
||
|
StaticFileHandler::_cleanpath (const char * const path)
|
||
|
{
|
||
|
//adds no security at all
|
||
|
return "static/"+std::string(path);
|
||
|
}
|
||
|
|
||
|
int
|
||
|
StaticFileHandler::answer_pathreq(const char * const path,
|
||
|
struct mg_connection *conn)
|
||
|
{
|
||
|
mg_send_file(conn,_cleanpath(path).c_str());
|
||
|
return 0;
|
||
|
}
|
||
|
|