* Fix $_SERVER error for unit test.

This commit is contained in:
caoyanyi
2023-05-25 14:38:47 +08:00
parent 1fc8e1d2d4
commit 78645d5145
+2
View File
@@ -2867,6 +2867,8 @@ EOF;
*/
public static function getSysURL()
{
if(defined('RUN_MODE') && RUN_MODE == 'test') return '';
$httpType = (isset($_SERVER["HTTPS"]) and $_SERVER["HTTPS"] == 'on') ? 'https' : 'http';
if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) and strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') $httpType = 'https';
if(isset($_SERVER['REQUEST_SCHEME']) and strtolower($_SERVER['REQUEST_SCHEME']) == 'https') $httpType = 'https';