Browse Source

Enhanced the detection of secure connection.

tags/2.0.0-beta
Qiang Xue 12 years ago
parent
commit
b2e7aa3114
  1. 3
      yii/web/Request.php

3
yii/web/Request.php

@ -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';
}
/**

Loading…
Cancel
Save