rewrite the HTTP_X_FORWARDED_PROTO test to just make it part of the if instead of modifying SERVER['HTTPS']

This commit is contained in:
Isaac Connor 2018-07-12 11:38:58 -04:00
parent 87f68e4a5b
commit eb610cd3a1
1 changed files with 5 additions and 2 deletions

View File

@ -51,9 +51,12 @@ require_once( 'includes/Event.php' );
require_once( 'includes/Group.php' );
require_once( 'includes/Monitor.php' );
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on';
if ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ) {
if (
(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')
or
($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
) {
$protocol = 'https';
} else {
$protocol = 'http';