Browse Source

Allow also non CLI

mscherer 2 years ago
parent
commit
fb4299527b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Utility/Utility.php

+ 1 - 1
src/Utility/Utility.php

@@ -378,7 +378,7 @@ class Utility {
 			}
 
 			if ($detectHttps === null) {
-				$detectHttps = !Configure::read('debug');
+				$detectHttps = !Configure::read('debug') || PHP_SAPI !== 'cli';
 			}
 			if ($prefix === 'http://' && $detectHttps && static::urlExists('https://' . $url)) {
 				$modifiedUrl = 'https://' . $url;