[Catalyst] unexpected behavior of $c->request->secure and $c->request->base

Phil Mitchell phil.mitchell at pobox.com
Fri Apr 24 22:48:36 GMT 2009


On Fri, Apr 24, 2009 at 2:22 PM, Tomas Doran <bobtfish at bobtfish.net> wrote:

>
> On 24 Apr 2009, at 22:10, seasprocket at gmail.com wrote:
>
>  The expected behavior (for me) is that secure() returns true if the
>> connection is secured via SSL.
>>
>> Looking at Engine::CGI, it appears that it only returns true if
>> $ENV{HTTPS} eq 'ON'  or if you're on Port 443.
>>
>> Furthermore, if secure fails because you're on a non-standard port and
>> HTTPS is not set, then base returns the wrong base (http instead of http=
s).
>>
>> I am just really confused or is this desired behavior?
>>
>
> Neither of the above.
>
> It's a bit too simple.
>
> Please illustrate your use case and how the current behavior doesn't work
> for you, so we can work out what to do to instead / as well.
>
>
I am running mod_perl/Apache 2.0 and serving SSL on a non-standard port via
a VirtualHost. I thought my apache setup was vanilla, but perhaps not -- I
am no apache expert. It seems surprising to have to set an ENV variable in
order for $c->request->base to work correctly...

cheers,.

Phil

If it's useful, here's my setup:

<VirtualHost xx.xx.xx.xxx:444>
    SSLEngine on
    ServerName dev.myserver.org
    DocumentRoot /web/myroot
    Redirect /pub http://dev.myserver.org:8080/pub

  # enable SSL:
  SSLEngine on
  SSLCipherSuite
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
  SSLCertificateFile "my.crt"
  SSLCertificateKeyFile "my.key"

    <Location />
        SetHandler modperl
        PerlResponseHandler BCDB
     </Location>
    <LocationMatch "(/static|favicon.ico)">
        SetHandler default-handler
     </LocationMatch>
</VirtualHost>







-- =

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
2People citizen's network for climate action: http://www.2people.org

Greater Seattle Climate Dialogues: http://www.climatedialogues.org
The Great Warming coalition
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090424/bd3d1=
5c5/attachment.htm


More information about the Catalyst mailing list