diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-11 15:06:05 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-11 15:06:05 +0000 |
commit | 14326e2186e95f491b2af3d04e1db9609838697a (patch) | |
tree | 50795e8c2a76f60edd59d7b99ede8ebdc9b9f254 /src/modules | |
parent | dd87b2ce75c07f6724bce0801483e7ed69b7417f (diff) |
Check for uri and only claim /stats and /stats/
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4340 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-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"); + } } } |