From 24f1f6c974caa2d9571f74321d57b595e2de28bd Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Mon, 3 Jun 2024 19:48:39 +0200 Subject: [PATCH] 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. --- index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 42d4dfc..a5d90e7 100644 --- a/index.php +++ b/index.php @@ -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; @@ -66,4 +67,4 @@ function getArrayValue($elem, $array) { $new_array = $new_array[$i]; } return $new_array; -} \ No newline at end of file +}