LoginSignup
1
1

More than 5 years have passed since last update.

AWS 用の Zend_Controller_Request

Posted at

ELB経由だとSSL判定がアレなので上書き。

Proxy.php
<?php
require_once 'Zend/Controller/Request/Http.php';

/**
 * My_Controller_Request_Proxy
 */
class My_Controller_Request_Proxy extends Zend_Controller_Request_Http
{
    /**
     * Is https secure request
     * @return boolean
     */
    public function isSecure()
    {
        return (parent::isSecure()
            || $this->getServer('HTTP_X_FORWARDED_PROTO') === parent::SCHEME_HTTPS);
    }
}

設定はBootstrapとかに書けばいいんじゃないかな。

Bootstrap.php
$frontController->setRequest(new My_Controller_Request_Proxy());
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1