no-cache option for apps running on wildcard domains.
Simon Elliott [Tue, 27 Feb 2007 19:50:24 +0000 (19:50 +0000)]
lib/Catalyst/Plugin/RequireSSL.pm

index 194661a..0b72c8a 100644 (file)
@@ -104,7 +104,9 @@ sub _redirect_uri {
         }
         $redir .= '?' . join( '&', @params );
     }        
-        
+       if($c->config->{require_ssl}->{'no_cache'}) {           
+           $c->config->{require_ssl}->{$type} = undef;
+       }
     return $redir;
 }
 
@@ -125,6 +127,7 @@ Catalyst::Plugin::RequireSSL - Force SSL mode on select pages
         https => 'secure.mydomain.com',
         http => 'www.mydomain.com',
         remain_in_ssl => 0,
+               no_cache => 0,
     };
 
     # in any controller methods that should be secured
@@ -168,6 +171,11 @@ If you'd like your users to remain in SSL mode after visiting an SSL-required
 page, you can set this option to 1.  By default, this option is disabled and
 users will be redirected back to non-SSL mode as soon as possible.
 
+       no_cache 
+
+If you have a wildcard certificate you will need to set this option if you are
+using multiple domains on one instance of catalyst.
+
 =head1 METHODS
 
 =head2 require_ssl
@@ -196,6 +204,10 @@ L<Catalyst>, L<Catalyst::Plugin::Static::Simple>
 
 Andy Grundman, <andy@hybridized.org>
 
+=head1 CONTRIBUTORS
+
+Simon Elliott <simon@browsing.co.uk> (support for wildcards)
+
 =head1 COPYRIGHT
 
 This program is free software, you can redistribute it and/or modify it under