fix: 部分虚拟机提供商的HTTPS值为ON,导致['HTTPS'] == 'on'失效,转换为小写后比较 (#1344)

This commit is contained in:
Annun 2025-09-23 11:24:58 +08:00 committed by GitHub
commit cc3426aebe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -257,7 +257,7 @@ if (empty($auth_users)) {
$use_auth = false;
}
$is_https = isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1)
$is_https = isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) == 'on' || $_SERVER['HTTPS'] == 1)
|| isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https';
// update $root_url based on user specific directories