21 lines
425 B
C++
21 lines
425 B
C++
#include "MediocreSimpleStaticFileHandler.H"
|
|
//#include "InputMemmoryFile.H"
|
|
class MediocreSimpleStaticFileHandler :StaticFileHandler
|
|
{
|
|
private:
|
|
|
|
std::string cleanpath (const char * const path){
|
|
//adds no security at all
|
|
return std::string(path);
|
|
}
|
|
|
|
public:
|
|
int answer_pathreq(const char * const path,
|
|
struct mg_connection *conn)
|
|
{
|
|
mg_send_file(conn,cleanpath(path).to_cstring());
|
|
return 0;
|
|
}
|
|
}
|
|
|