[Catalyst-commits] r9913 - in trunk/Catalyst-Controller-WrapCGI:
lib/Catalyst/Controller t t/lib/TestApp/Controller
hdp at dev.catalyst.perl.org
hdp at dev.catalyst.perl.org
Tue Apr 28 17:00:39 GMT 2009
Author: hdp
Date: 2009-04-28 18:00:38 +0100 (Tue, 28 Apr 2009)
New Revision: 9913
Modified:
trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/WrapCGI.pm
trunk/Catalyst-Controller-WrapCGI/t/lib/TestApp/Controller/Root.pm
trunk/Catalyst-Controller-WrapCGI/t/wrap-cgi.t
Log:
kill CONTENT_TYPE too
Modified: trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/WrapCGI.pm
===================================================================
--- trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/WrapCGI.pm 2009-04-28 16:42:52 UTC (rev 9912)
+++ trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/WrapCGI.pm 2009-04-28 17:00:38 UTC (rev 9913)
@@ -76,8 +76,9 @@
it to your CGIs. Entries surrounded by C</> characters are considered regular
expressions.
-Default is to pass the whole of C<%ENV>, except for C<MOD_PERL> (that is, the
-default C<kill_env> is C<[ 'MOD_PERL' ]>.
+Default is to pass the whole of C<%ENV>, except for C<MOD_PERL> and
+C<CONTENT_TYPE> (that is, the default C<kill_env> is C<[ qw(MOD_PERL
+CONTENT_TYPE) ]>.
C<< $your_controller->{CGI}{username_field} >> should be the field for your user's name, which will be
read from C<< $c->user->obj >>. Defaults to 'username'.
@@ -217,7 +218,7 @@
$pass_env = [ $pass_env ] unless ref $pass_env;
my $kill_env = $self->{CGI}{kill_env};
- $kill_env = [ 'MOD_PERL' ] unless defined $kill_env;
+ $kill_env = [ 'MOD_PERL', 'CONTENT_TYPE' ] unless defined $kill_env;
$kill_env = [ $kill_env ] unless ref $kill_env;
if (@$pass_env) {
Modified: trunk/Catalyst-Controller-WrapCGI/t/lib/TestApp/Controller/Root.pm
===================================================================
--- trunk/Catalyst-Controller-WrapCGI/t/lib/TestApp/Controller/Root.pm 2009-04-28 16:42:52 UTC (rev 9912)
+++ trunk/Catalyst-Controller-WrapCGI/t/lib/TestApp/Controller/Root.pm 2009-04-28 17:00:38 UTC (rev 9913)
@@ -8,7 +8,7 @@
my $cgi = sub {
my $cgi = CGI->new;
print $cgi->header;
- print 'foo:',$cgi->param('foo'),' bar:',$cgi->param('bar')
+ print 'foo:',$cgi->param('foo'),' bar:',$cgi->param('bar');
};
sub handle_cgi : Path('/cgi-bin/test.cgi') {
Modified: trunk/Catalyst-Controller-WrapCGI/t/wrap-cgi.t
===================================================================
--- trunk/Catalyst-Controller-WrapCGI/t/wrap-cgi.t 2009-04-28 16:42:52 UTC (rev 9912)
+++ trunk/Catalyst-Controller-WrapCGI/t/wrap-cgi.t 2009-04-28 17:00:38 UTC (rev 9913)
@@ -6,7 +6,7 @@
use FindBin '$Bin';
use lib "$Bin/lib";
-use Test::More tests => 4;
+use Test::More tests => 5;
use Catalyst::Test 'TestApp';
use HTTP::Request::Common;
@@ -18,6 +18,13 @@
is($response->content, 'foo:bar bar:baz', 'POST to CGI');
+$response = request POST '/cgi-bin/test.cgi', [
+ foo => 'bar',
+ bar => 'baz',
+], 'Content-Type' => 'form-data';
+
+is($response->content, 'foo:bar bar:baz', 'POST to CGI (form-data)');
+
$response = request '/cgi-bin/test_pathinfo.cgi/path/%2Finfo';
is($response->content, '/path/%2Finfo', 'PATH_INFO is correct');
More information about the Catalyst-commits
mailing list