From eb610cd3a10ade5ef4aa5d7877cfb902dd3398ff Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 12 Jul 2018 11:38:58 -0400 Subject: [PATCH] rewrite the HTTP_X_FORWARDED_PROTO test to just make it part of the if instead of modifying SERVER['HTTPS'] --- web/index.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/index.php b/web/index.php index fae6d5e21..4a37241a7 100644 --- a/web/index.php +++ b/web/index.php @@ -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';