Hi,
I work alot with Facebook, and like it’s integration with heroku. I ran into a problem that took me quite a while to figure out.
I use $this->redirect(’/module/controller/action’) to go from one module to another.
Apperently when the first char is a ‘/’. Yii prepends HostInfo, which checks for a secure connection through $_SERVER[‘HTTPS’].
public function getIsSecureConnection()
{
return isset($_SERVER['HTTPS']) && !strcasecmp($_SERVER['HTTPS'],'on');
}
Heroku doesn’t have that property. Instead it uses
$_SERVER['HTTP_X_FORWARDED_PROTO'] = https
So yii appends a http://domain.com/ and breaks the ssl connection. Since facebook users can have a http connection alsoo, I cannot force https in every url.
I was wondering: What is a good way to overwrite the way how Yii detects what type of protocol the server is on. A way which would allow me to work a normal natural way (using $this->redirect // CController::redirect // yii->app()->request->redirect). Can you extend CHTTPRequest and overwrite getIsSecureConnection before the app has started (so it bubbles down to all existing modules)