Enhanced the detection of secure connection.

This commit is contained in:
Qiang Xue
2013-05-20 23:02:38 -04:00
parent cc7c6c7aac
commit b2e7aa3114

View File

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