diff options
| author | 2022-05-21 13:34:19 +0100 | |
|---|---|---|
| committer | 2022-05-21 13:34:19 +0100 | |
| commit | 4005b31d1712c00f6d9073844219a5fea775b60c (patch) | |
| tree | 73f1c056a3f06dc50653b2ddf14e517d16ebafe2 /src/modules/m_httpd_stats.cpp | |
| parent | Update links to point to the upcoming v4 docs. (diff) | |
| parent | Fix httpd_stats swallowing requests that it doesn't handle. (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_httpd_stats.cpp')
| -rw-r--r-- | src/modules/m_httpd_stats.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index b9eed6447..b2c8841e3 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -412,10 +412,8 @@ public: ServerInstance->Logs.Debug(MODNAME, "Handling HTTP request for %s", http->GetPath().c_str()); - bool found = true; std::stringstream data; data << "<inspircdstats>"; - if (http->GetPath() == "/stats") { data << Stats::ServerInfo << Stats::General @@ -436,21 +434,12 @@ public: } else { - found = false; - } - - if (found) - { - data << "</inspircdstats>"; - } - else - { - data.clear(); - data.str(std::string()); + return MOD_RES_PASSTHRU; } + data << "</inspircdstats>"; /* Send the document back to m_httpd */ - HTTPDocumentResponse response(this, *http, &data, found ? 200 : 404); + HTTPDocumentResponse response(this, *http, &data, 200); response.headers.SetHeader("X-Powered-By", MODNAME); response.headers.SetHeader("Content-Type", "text/xml"); API->SendResponse(response); |
