Added new API JSON-based auth scheme
# Conflicts: # src/controller/controller_api.cpp
This commit is contained in:
parent
d3d93eb4da
commit
2443fcff92
1 changed files with 13 additions and 0 deletions
|
@ -145,6 +145,19 @@ int Controller::handleAPIConnection(Socket::Connection & conn){
|
|||
}
|
||||
}
|
||||
}
|
||||
//Catch prometheus requests
|
||||
if (Controller::prometheus.size()){
|
||||
if (H.url == "/"+Controller::prometheus){
|
||||
handlePrometheus(H, conn, PROMETHEUS_TEXT);
|
||||
H.Clean();
|
||||
continue;
|
||||
}
|
||||
if (H.url == "/"+Controller::prometheus+".json"){
|
||||
handlePrometheus(H, conn, PROMETHEUS_JSON);
|
||||
H.Clean();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
JSON::Value Response;
|
||||
JSON::Value Request = JSON::fromString(H.GetVar("command"));
|
||||
//invalid request? send the web interface, unless requested as "/api"
|
||||
|
|
Loading…
Add table
Reference in a new issue