PMC-541-B

This commit is contained in:
Roly Rudy Gutierrez Pinto
2019-03-25 08:09:11 -04:00
parent a68b707ecd
commit f84e73580c
3 changed files with 8 additions and 3 deletions

View File

@@ -160,7 +160,13 @@ try {
define('SERVER_NAME', $SERVER_INFO['SERVER_NAME']);
define('SERVER_PORT', $SERVER_INFO['SERVER_PORT']);
define('REQUEST_SCHEME', $SERVER_INFO['REQUEST_SCHEME']);
//to do improvement G::is_https()
if ((isset($SERVER_INFO['HTTPS']) && $SERVER_INFO['HTTPS'] == 'on') ||
(isset($SERVER_INFO['HTTP_X_FORWARDED_PROTO']) && $SERVER_INFO['HTTP_X_FORWARDED_PROTO'] == 'https')) {
define('REQUEST_SCHEME', 'https');
} else {
define('REQUEST_SCHEME', $SERVER_INFO['REQUEST_SCHEME']);
}
} else {
eprintln('WARNING! No server info found!', 'red');
}