モノノフ日記

普通の日記です

sfSslRequirementPluginの問題点

symfonySSLにしたいアクションをyamlで指定できる便利なプラグインsfSslRequimentPluginでハマってます。
http://trac.symfony-project.com/wiki/sfSslRequirementPlugin

どうやらhttpとhttpsの標準ポートである80番と443番以外を使ってるとリダイレクト無限ループに陥ってしまう。
既にbugチケットが発行されているのでそのうち対応されると思いますが、当面どうしようか考え中。

443をソース上で指定してんだろうと思ってgrepで探してみた。

grep -n -R '443' /path/to/php/symfony
/path/to/php/symfony/request/sfWebRequest.class.php:402:      $standardPort = '443';

発見。sfWebRequestクラスのgetUriPrefixメソッドに書かれてた。

<?php
  /**
   * Returns Uri prefix, including protocol, hostname and server port.
   *
   * @return string Uniform resource identifier prefix
   */
  public function getUriPrefix()
  {
    $pathArray = $this->getPathInfoArray();
    if ($this->isSecure())
    {
      $standardPort = '443';
      $proto = 'https';
    }
    else
    {
      $standardPort = '80';
      $proto = 'http';
    }

    $port = $pathArray['SERVER_PORT'] == $standardPort || !$pathArray['SERVER_PORT'] ? 
            '' : ':'.$pathArray['SERVER_PORT'];

    return $proto.'://'.$pathArray['SERVER_NAME'].$port;
  }

443→4430に変更してみたけど、特に変化無し。。。
こりゃmod_rewrite使ってごまかすのが得策かなぁ。