From 11a204584414341650c02f0fadda77e08a4abce6 Mon Sep 17 00:00:00 2001 From: Franzz Date: Sat, 5 Oct 2019 23:40:46 +0200 Subject: [PATCH] Fix http scheme detection --- inc/auth.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/auth.php b/inc/auth.php index 21e4d87..bd789ef 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -177,7 +177,8 @@ class Auth extends PhpObject { //Add Server Name $sServerName = array_key_exists('SERVER_NAME', $_SERVER)?$_SERVER['SERVER_NAME']:$_SERVER['PWD']; - $sAppPath = $_SERVER['REQUEST_SCHEME'].'://'.str_replace(array('http://', 'https://'), '', $sServerName.dirname($_SERVER['SCRIPT_NAME'])); + $sScheme = array_key_exists('HTTP_X_FORWARDED_PROTO', $_SERVER)?$_SERVER['HTTP_X_FORWARDED_PROTO']:$_SERVER['REQUEST_SCHEME']; + $sAppPath = $sScheme.'://'.str_replace(array('http://', 'https://'), '', $sServerName.dirname($_SERVER['SCRIPT_NAME'])); $_GET['serv_name'] = $sAppPath.(mb_substr($sAppPath, -1)!='/'?'/':''); return md5($sPass.$_GET['serv_name']); }