- if (event->GetEventID() == "httpd_url")
- {
- ServerInstance->Logs->Log("m_http_stats", DEBUG,"Handling httpd event");
- HTTPRequest* http = (HTTPRequest*)event->GetData();
-
- if ((http->GetURI() == "/config") || (http->GetURI() == "/config/"))
- {
- data << "<html><head><title>InspIRCd Configuration</title></head><body>";
- data << "<h1>InspIRCd Configuration</h1><p>";
-
- for (ConfigDataHash::iterator x = ServerInstance->Config->config_data.begin(); x != ServerInstance->Config->config_data.end(); ++x)
- {
- data << "<" << x->first << " ";
- for (KeyValList::iterator j = x->second.begin(); j != x->second.end(); j++)
- {
- data << j->first << "="" << j->second << "" ";
- }
- data << "><br>";
- }
-
- data << "</body></html>";
- /* Send the document back to m_httpd */
- HTTPDocument response(http->sock, &data, 200);
- response.headers.SetHeader("X-Powered-By", "m_httpd_config.so");
- response.headers.SetHeader("Content-Type", "text/html");
- Request req((char*)&response, (Module*)this, event->GetSource());
- req.Send();
- }
- }
- }
-
- const char* OnRequest(Request* request)
- {
- return NULL;
- }
-
-
- virtual ~ModuleHttpStats()
- {
+ HTTPDocumentResponse response(this, request, &buffer, 200);
+ response.headers.SetHeader("X-Powered-By", MODNAME);
+ response.headers.SetHeader("Content-Type", "text/plain");
+ API->SendResponse(response);
+ return MOD_RES_DENY;