From 41f2ddea3709b0a8464d535b77b79997dfa153ad Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Mon, 3 Jun 2024 23:41:42 +0200 Subject: [PATCH] Reorder conditional for CLI check, then URI comparison. - Reordered the condition to first check for CLI mode before URI comparison. --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index a5d90e7..0cc6d81 100644 --- a/index.php +++ b/index.php @@ -2,7 +2,7 @@ require 'vendor/autoload.php'; require 'config.php'; -if($_SERVER["REQUEST_URI"] == '/metrics' || php_sapi_name() == 'cli') { +if(php_sapi_name() == 'cli' || $_SERVER["REQUEST_URI"] == '/metrics') { header('Content-Type: text/plain; version=0.0.4'); foreach ($config as $key => &$c) { if(isset($c['command'])) {