C::C::WrapCGI - PATH_INFO and configurable cgi_dir
[catagits/Catalyst-Controller-WrapCGI.git] / t / lib / TestApp / Controller / Root.pm
CommitLineData
457c1d76 1package TestApp::Controller::Root;
2
3use parent 'Catalyst::Controller::WrapCGI';
12d29ebf 4use CGI ();
457c1d76 5
6__PACKAGE__->config->{namespace} = '';
7
8my $cgi = sub {
12d29ebf 9 my $cgi = CGI->new;
10 print $cgi->header;
11 print 'foo:',$cgi->param('foo'),' bar:',$cgi->param('bar')
457c1d76 12};
13
14sub handle_cgi : Path('/cgi-bin/test.cgi') {
15 my ($self, $c) = @_;
16 $self->cgi_to_response($c, $cgi);
17}
18
0d83c5de 19sub test_path_info : Path('/cgi-bin/test_pathinfo.cgi') {
20 my ($self, $c) = @_;
21
22 $self->cgi_to_response($c, sub {
23 my $cgi = CGI->new;
24 print $cgi->header;
25 print $ENV{PATH_INFO}
26 });
27}
28
f410f043 29sub test_filepath_info : Path('/cgi-bin/test_filepathinfo.cgi') {
30 my ($self, $c) = @_;
31
32 $self->cgi_to_response($c, sub {
33 my $cgi = CGI->new;
34 print $cgi->header;
35 print $ENV{FILEPATH_INFO}
36 });
37}
38
39sub test_script_name : Path('/cgi-bin/test_scriptname.cgi') {
40 my ($self, $c) = @_;
41
42 $self->cgi_to_response($c, sub {
43 my $cgi = CGI->new;
44 print $cgi->header;
45 print $ENV{SCRIPT_NAME}
46 });
47}
48
457c1d76 491;