aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_httpd_stats.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2020-12-04 18:18:07 +0000
committerGravatar Sadie Powell2020-12-04 18:44:40 +0000
commit3ab889537fb4c7b5b3507562563eec8211d0cc58 (patch)
tree254ba171bfe3c8d0ebd4826cc2d51c7befbd6fc2 /src/modules/m_httpd_stats.cpp
parentMove ban checking to core_channel. (diff)
parentImprove the logging of service adding/deleting. (diff)
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_httpd_stats.cpp')
-rw-r--r--src/modules/m_httpd_stats.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp
index 618d5d58d..fe7377c2c 100644
--- a/src/modules/m_httpd_stats.cpp
+++ b/src/modules/m_httpd_stats.cpp
@@ -432,32 +432,27 @@ class ModuleHttpStats : public Module, public HTTPRequestEventListener
ModResult HandleRequest(HTTPRequest* http)
{
- std::string path = http->GetPath();
-
- if (path != "/stats" && path.substr(0, 7) != "/stats/")
+ if (http->GetPath() != "/stats")
return MOD_RES_PASSTHRU;
- if (path[path.size() - 1] == '/')
- path.erase(path.size() - 1, 1);
-
- ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Handling httpd event");
+ ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Handling HTTP request for %s", http->GetPath().c_str());
bool found = true;
std::stringstream data;
data << "<inspircdstats>";
- if (path == "/stats")
+ if (http->GetPath() == "/stats")
{
data << Stats::ServerInfo << Stats::General
<< Stats::XLines << Stats::Modules
<< Stats::Channels << Stats::Users
<< Stats::Servers << Stats::Commands;
}
- else if (path == "/stats/general")
+ else if (http->GetPath() == "/stats/general")
{
data << Stats::General;
}
- else if (path == "/stats/users")
+ else if (http->GetPath() == "/stats/users")
{
if (enableparams)
Stats::ListUsers(data, http->GetParsedURI().query_params);