diff options
-rw-r--r-- | src/modules/m_httpd_stats.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index 526f9fda2..7c43d19d8 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -51,22 +51,26 @@ class ModuleHttpStats : public Module if (event->GetEventID() == "httpd_url") { - log(DEBUG,"HTTP URL!"); + HTTPRequest* http = (HTTPRequest*)event->GetData(); - data << "<HTML><HEAD>"; - data << "<TITLE>InspIRCd server statisitics for " << Srv->GetServerName() << " (" << Srv->GetServerDescription() << ")</TITLE>"; - data << "</HEAD><BODY>"; - data << "<H1>InspIRCd server statisitics for " << Srv->GetServerName() << " (" << Srv->GetServerDescription() << ")</H1>"; - - data << "</BODY>"; - data << "</HTML>"; + if ((http->GetURI() == "/stats") || (http->GetURI() == "/stats/")) + { + log(DEBUG,"HTTP URL!"); - HTTPRequest* http = (HTTPRequest*)event->GetData(); - HTTPDocument response(http->sock, &data, 200, "X-Powered-By: m_http_stats.so\r\nContent-Type: text/html\r\n"); - Request req((char*)&response, (Module*)this, event->GetSource()); - req.Send(); + data << "<HTML><HEAD>"; + data << "<TITLE>InspIRCd server statisitics for " << Srv->GetServerName() << " (" << Srv->GetServerDescription() << ")</TITLE>"; + data << "</HEAD><BODY>"; + data << "<H1>InspIRCd server statisitics for " << Srv->GetServerName() << " (" << Srv->GetServerDescription() << ")</H1>"; + + data << "</BODY>"; + data << "</HTML>"; + + HTTPDocument response(http->sock, &data, 200, "X-Powered-By: m_http_stats.so\r\nContent-Type: text/html\r\n"); + Request req((char*)&response, (Module*)this, event->GetSource()); + req.Send(); - log(DEBUG,"Sent"); + log(DEBUG,"Sent"); + } } } |