[Catalyst] RequiresSLL and the little lock (patch)

Bill Moseley moseley at hank.org
Tue May 23 06:39:45 CEST 2006


On Mon, May 22, 2006 at 07:04:13PM -0600, Justin Guenther wrote:
> Is your SSL certificate valid and signed?

Sure.  Self-signed.

I just missed the redirects that C::P::RequireSSL was doing.

Andy, how about this attached patch?



-- 
Bill Moseley
moseley at hank.org

-------------- next part --------------
Index: lib/Catalyst/Plugin/RequireSSL.pm
===================================================================
--- lib/Catalyst/Plugin/RequireSSL.pm	(revision 4187)
+++ lib/Catalyst/Plugin/RequireSSL.pm	(working copy)
@@ -27,12 +27,11 @@
 
 sub finalize {
     my $c = shift;
-    
-    # Do not redirect static files (only works with Static::Simple)
-    if ( $c->isa( "Catalyst::Plugin::Static::Simple" ) ) {
-        return $c->NEXT::finalize(@_) if $c->_static_file;
-    }
-    
+
+    # Do not redirect static files
+    # works with Static::Simple or any code that supplies _static_file
+    return $c->NEXT::finalize(@_) if $c->can('_static_file') && $c->_static_file;
+
     # redirect back to non-SSL mode
     REDIRECT:
     {


More information about the Catalyst mailing list