aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-11-25 16:57:01 +0100
committerKim Alvefur <zash@zash.se>2021-11-25 16:57:01 +0100
commit17aad028b3abca9d8ba6e067dce2b9bbf29136fd (patch)
tree73797c0a9dbf12037418afaaef3a5db7f7b1fac5
parente29326533e52a8fc146ea0e58124a60d5ee306b0 (diff)
downloadprosody-17aad028b3abca9d8ba6e067dce2b9bbf29136fd.tar.gz
prosody-17aad028b3abca9d8ba6e067dce2b9bbf29136fd.zip
mod_http_openmetrics: Serve HTTP from global context
Makes GET /metrics work regardless of the value of the Host header. This was not possible before 220468f7a103 which added the ability to have global HTTP modules, which was partly why the per-host part was kept while the module lived among the community modules. Another reason was to provide some semblance of security by obscurity by only loading the module on e.g. a 'localhost' VirtualHost or Component. The new IP limits obsoletes this.
-rw-r--r--plugins/mod_http_openmetrics.lua16
1 files changed, 7 insertions, 9 deletions
diff --git a/plugins/mod_http_openmetrics.lua b/plugins/mod_http_openmetrics.lua
index 78cd6fd4..0c204ff4 100644
--- a/plugins/mod_http_openmetrics.lua
+++ b/plugins/mod_http_openmetrics.lua
@@ -51,12 +51,10 @@ function get_metrics(event)
return registry:render();
end
-function module.add_host(module)
- module:depends "http";
- module:provides("http", {
- default_path = "metrics";
- route = {
- GET = get_metrics;
- };
- });
-end
+module:depends "http";
+module:provides("http", {
+ default_path = "metrics";
+ route = {
+ GET = get_metrics;
+ };
+});