diff --git a/www/internals/utils.php b/www/internals/utils.php index 46228a0..0eff6b7 100644 --- a/www/internals/utils.php +++ b/www/internals/utils.php @@ -222,7 +222,11 @@ function getRandomToken($length = 32) function isHTTPRequest() { - return (!isset($_SERVER['HTTPS'])) || empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off"; + if (isset($_SERVER['HTTP_X_FORWARDED_PROTOCOL']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTOCOL']) === "https" ) return false; + + if (isset($_SERVER['HTTPS']) && (!empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] !== "off")) return false; + + return true; } function str_max_len(string $str, int $max)