[Catalyst-dev] Catalyst::Action::MatchSecureOnly
Ido Rosen
ido at cpan.org
Sat Oct 21 02:56:49 CEST 2006
# Do with this what you will...
package Catalyst::Action::MatchSecureOnly;
our $VERSION='0.01';
use strict;
use base 'Catalyst::Action';
use NEXT;
sub match {
my ($self) = shift;
return $c->req->secure && $self->NEXT::match(@_);
}
=head1 NAME
Catalyst::Action::MatchSecureOnly - sensible way of requiring SSL for an action
=head1 SYNOPSIS
sub foo : ActionClass('MatchSecureOnly') {}
=head1 DESCRIPTION
This ActionClass prevents execution of an action if the connection is not secure
It does not handle redirection to the secure site -- you must do that yoursel
f. It provides a subset of the features offered by my original Secure DispatchT
ype, which I will reimplement fully as an ActionClass once some issues with Acti
onClasses are resolved.
=head1 AUTHOR
Ido Rosen <ido at cpan.org>
=head1 LICENSE
This library is free software. You can redistribute it and/or modify it
under the same terms as Perl itself.
=cut
1;
More information about the Catalyst-dev
mailing list