Add content type header for metrics endpoint
Set the Content-Type header to 'text/plain; version=0.0.4' for the '/metrics' endpoint and CLI requests.
This commit is contained in:
parent
82c988baaa
commit
ff34aaa394
@ -3,6 +3,7 @@ require 'vendor/autoload.php';
|
|||||||
require 'config.php';
|
require 'config.php';
|
||||||
|
|
||||||
if($_SERVER["REQUEST_URI"] == '/metrics' || php_sapi_name() == 'cli') {
|
if($_SERVER["REQUEST_URI"] == '/metrics' || php_sapi_name() == 'cli') {
|
||||||
|
header('Content-Type: text/plain; version=0.0.4');
|
||||||
foreach ($config as $key => &$c) {
|
foreach ($config as $key => &$c) {
|
||||||
if(isset($c['command'])) {
|
if(isset($c['command'])) {
|
||||||
$output=null;
|
$output=null;
|
||||||
@ -66,4 +67,4 @@ function getArrayValue($elem, $array) {
|
|||||||
$new_array = $new_array[$i];
|
$new_array = $new_array[$i];
|
||||||
}
|
}
|
||||||
return $new_array;
|
return $new_array;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user