diff --git a/application/utils.inc.php b/application/utils.inc.php index 5daf209b3..5909a4fe3 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -783,7 +783,7 @@ class utils } /** - * @return bool The boolean value of the conf. "trust_proxies" (except if there is no REMOTE_ADDR int his case, it return false) + * @return bool The boolean value of the conf. "behind_reverse_proxy" (except if there is no REMOTE_ADDR int his case, it return false) * * @since 2.7.4 */ @@ -793,7 +793,7 @@ class utils return false; } - $bTrustProxies = (bool) self::GetConfig()->Get('trust_proxies'); + $bTrustProxies = (bool) self::GetConfig()->Get('behind_reverse_proxy'); return $bTrustProxies; } diff --git a/core/config.class.inc.php b/core/config.class.inc.php index 313bb1b94..8881d6ad3 100644 --- a/core/config.class.inc.php +++ b/core/config.class.inc.php @@ -1265,13 +1265,13 @@ class Config 'source_of_value' => '', 'show_in_conf_sample' => false, ], - 'trust_proxies' => [ + 'behind_reverse_proxy' => [ 'type' => 'bool', 'description' => 'If true, then proxies custom header (X-Forwarded-*) are taken into account. Use only if the webserver is not publicly accessible (reachable only by the reverse proxy)', 'default' => false, 'value' => false, 'source_of_value' => '', - 'show_in_conf_sample' => false, + 'show_in_conf_sample' => true, ], ); diff --git a/setup/setuppage.class.inc.php b/setup/setuppage.class.inc.php index 2c4bbef22..a25ad3d23 100644 --- a/setup/setuppage.class.inc.php +++ b/setup/setuppage.class.inc.php @@ -144,7 +144,7 @@ class SetupPage extends NiceWebPage public function output() { - $sLogo = utils::GetAbsoluteUrlAppRoot(true).'/images/itop-logo.png'; + $sLogo = utils::GetAbsoluteUrlAppRoot().'/images/itop-logo.png'; $this->s_content = "

\" ".htmlentities($this->s_title, ENT_QUOTES, self::PAGES_CHARSET)."

\n
{$this->s_content}\n
\n"; diff --git a/test/application/UtilsTest.php b/test/application/UtilsTest.php index 210995a98..73425f61d 100644 --- a/test/application/UtilsTest.php +++ b/test/application/UtilsTest.php @@ -208,7 +208,7 @@ class UtilsTest extends \Combodo\iTop\Test\UnitTest\ItopTestCase public function testGetDefaultUrlAppRootPersistWhenTrustProxyActivatedAtFirst($bForceTrustProxy, $bConfTrustProxy, $aServerVars, $sExpectedAppRootUrl) { $_SERVER = $aServerVars; - utils::GetConfig()->Set('trust_proxies', $bConfTrustProxy); + utils::GetConfig()->Set('behind_reverse_proxy', $bConfTrustProxy); $sAppRootUrl = utils::GetDefaultUrlAppRoot($bForceTrustProxy); $this->assertEquals($sExpectedAppRootUrl, $sAppRootUrl); $sPersistedExpectedAppRootUrl = $sAppRootUrl; @@ -231,7 +231,7 @@ class UtilsTest extends \Combodo\iTop\Test\UnitTest\ItopTestCase public function testGetDefaultUrlAppRoot($bForceTrustProxy, $bConfTrustProxy, $aServerVars, $sExpectedAppRootUrl) { $_SERVER = $aServerVars; - utils::GetConfig()->Set('trust_proxies', $bConfTrustProxy); + utils::GetConfig()->Set('behind_reverse_proxy', $bConfTrustProxy); $sAppRootUrl = utils::GetDefaultUrlAppRoot($bForceTrustProxy); $this->assertEquals($sExpectedAppRootUrl, $sAppRootUrl); }