Skip to content

Commit

Permalink
Fix: Deny passwordless access to prometheus API if readonly access is…
Browse files Browse the repository at this point in the history
… disabled

Fix #1358
  • Loading branch information
tbnobody committed Sep 19, 2023
1 parent d419fd4 commit f8cba57
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/WebApi_prometheus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ void WebApiPrometheusClass::loop()

void WebApiPrometheusClass::onPrometheusMetricsGet(AsyncWebServerRequest* request)
{
if (!WebApi.checkCredentialsReadonly(request)) {
return;
}

try {
auto stream = request->beginResponseStream("text/plain; charset=utf-8", 40960);

Expand Down

0 comments on commit f8cba57

Please sign in to comment.