Browse Source

Fixes issue #457: incorrect HTTPS detection.

tags/2.0.0-beta
Qiang Xue 12 years ago
parent
commit
66e698673d
  1. 2
      framework/yii/web/Request.php

2
framework/yii/web/Request.php

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

Loading…
Cancel
Save