Fixes issue #457: incorrect HTTPS detection.

This commit is contained in:
Qiang Xue
2013-05-29 21:53:25 -04:00
parent f3cfc60d6c
commit 66e698673d
2 changed files with 3 additions and 3 deletions

View File

@@ -533,8 +533,8 @@ class Request extends \yii\base\Request
*/
public function getIsSecureConnection()
{
return isset($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'], 'off')
|| isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO']==='https';
return isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on' || $_SERVER['HTTPS'] == 1)
|| isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https';
}
/**