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:
Jeroen De Meerleer 2024-06-03 19:48:39 +02:00
parent 6f26907181
commit 24f1f6c974
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6

View File

@ -3,6 +3,7 @@ require 'vendor/autoload.php';
require 'config.php';
if($_SERVER["REQUEST_URI"] == '/metrics' || php_sapi_name() == 'cli') {
header('Content-Type: text/plain; version=0.0.4');
foreach ($config as $key => &$c) {
if(isset($c['command'])) {
$output=null;