From 17aad028b3abca9d8ba6e067dce2b9bbf29136fd Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 25 Nov 2021 16:57:01 +0100 Subject: 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. --- plugins/mod_http_openmetrics.lua | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'plugins/mod_http_openmetrics.lua') 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; + }; +}); -- cgit v1.2.3