Implemented detach_on_redirect config option.
[catagits/Catalyst-Plugin-RequireSSL.git] / t / lib / TestApp / Controller / SSL.pm
1 package TestApp::Controller::SSL;
2
3 use strict;
4 use base 'Catalyst::Controller';
5
6 sub secured : Local {
7     my ( $self, $c ) = @_;
8     
9     $c->require_ssl;
10     
11     $c->res->output( 'Secured' );
12 }
13
14 sub unsecured : Local {
15     my ( $self, $c ) = @_;
16     
17     $c->res->output( 'Unsecured' );
18 }
19
20 sub maybe_secured : Local {
21     my ( $self, $c ) = @_;
22     
23     $c->allow_ssl;
24     
25     $c->res->output( 'Maybe secured' );
26 }
27
28 sub test_detach : Local {
29     my ( $self, $c ) = @_;
30     
31     $c->require_ssl;
32
33     $c->res->redirect('http://www.mydomain.com/redirect_from_the_action');
34     
35     $c->res->output( 'Test detach' );
36 }
37
38
39 1;