From b2e7aa3114dec20938bc61b677c5b639c7b1a84b Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Mon, 20 May 2013 23:02:38 -0400 Subject: [PATCH] Enhanced the detection of secure connection. --- yii/web/Request.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yii/web/Request.php b/yii/web/Request.php index 2f4568a74c..5cd6912209 100644 --- a/yii/web/Request.php +++ b/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'; } /**