mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-16 06:17:56 +08:00
Enhanced the detection of secure connection.
This commit is contained in:
@@ -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';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user