Improve secure connection detection (#161)

The previous code broke the setup page when the iTop server is behind a proxy that handles SSL termination.
Now the detection also checks the `HTTP_X_FORWARDED_PROTO` and `HTTP_X_FORWARDED_PROTOCOL` HTTP headers. 
For any other page than the setup, the check is unchanged.

Many thanks @Hipska !
This commit is contained in:
Thomas Casteleyn
2020-12-16 15:37:48 +01:00
committed by GitHub
parent 1b115624a2
commit 42354ba794
3 changed files with 31 additions and 14 deletions

View File

@@ -143,7 +143,7 @@ class SetupPage extends NiceWebPage
public function output()
{
$sLogo = utils::GetAbsoluteUrlAppRoot().'/images/itop-logo.png';
$sLogo = utils::GetAbsoluteUrlAppRoot(true).'/images/itop-logo.png';
$this->s_content = "<div id=\"header\"><h1><a href=\"http://www.combodo.com/itop\" target=\"_blank\"><img title=\"iTop by Combodo\" alt=\" \" src=\"{$sLogo}?t=".utils::GetCacheBusterTimestamp()."\"></a>&nbsp;".htmlentities($this->s_title,
ENT_QUOTES, self::PAGES_CHARSET)."</h1>\n</div><div id=\"setup\">{$this->s_content}\n</div>\n";