[fix] Add support for X-Forwarded-Proto header field #413

This commit is contained in:
Nicolas Lœuillet 2014-02-03 12:46:09 +01:00
parent 1e1fd6f24d
commit 445a1a1c8d
1 changed files with 3 additions and 1 deletions

View File

@ -43,7 +43,9 @@ class Tools
|| (isset($_SERVER["SERVER_PORT"]) || (isset($_SERVER["SERVER_PORT"])
&& $_SERVER["SERVER_PORT"] == '443') // HTTPS detection. && $_SERVER["SERVER_PORT"] == '443') // HTTPS detection.
|| (isset($_SERVER["SERVER_PORT"]) //Custom HTTPS port detection || (isset($_SERVER["SERVER_PORT"]) //Custom HTTPS port detection
&& $_SERVER["SERVER_PORT"] == SSL_PORT); && $_SERVER["SERVER_PORT"] == SSL_PORT)
|| (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])
&& $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https');
$serverport = (!isset($_SERVER["SERVER_PORT"]) $serverport = (!isset($_SERVER["SERVER_PORT"])
|| $_SERVER["SERVER_PORT"] == '80' || $_SERVER["SERVER_PORT"] == '80'