[Catalyst-commits] r9933 - 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
Wed Apr 29 03:18:27 GMT 2009
Author: hdp
Date: 2009-04-29 04:18:26 +0100 (Wed, 29 Apr 2009)
New Revision: 9933
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:
add test for multiple files and make it pass
Modified: trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/WrapCGI.pm
===================================================================
--- trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/WrapCGI.pm 2009-04-29 02:57:29 UTC (rev 9932)
+++ trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/WrapCGI.pm 2009-04-29 03:18:26 UTC (rev 9933)
@@ -169,11 +169,10 @@
undef,
$upl->filename,
Content => $upl->slurp,
- 'Content-Type' => $upl->type || 'application/octet-stream',
- map (
- $_ => $upl->headers->header($_)
- ), grep !/^Content-(?:Type|Disposition)$/,
- $upl->headers->header_field_names
+ map {
+ my $header = $_;
+ map { $header => $_ } $upl->headers->header($header)
+ } $upl->headers->header_field_names
]
} keys %uploads
];
Modified: trunk/Catalyst-Controller-WrapCGI/t/lib/TestApp/Controller/Root.pm
===================================================================
--- trunk/Catalyst-Controller-WrapCGI/t/lib/TestApp/Controller/Root.pm 2009-04-29 02:57:29 UTC (rev 9932)
+++ trunk/Catalyst-Controller-WrapCGI/t/lib/TestApp/Controller/Root.pm 2009-04-29 03:18:26 UTC (rev 9933)
@@ -13,6 +13,10 @@
local $/;
print ' baz:',<$fh>;
}
+ if (my $fh = $cgi->param('quux')) {
+ local $/;
+ print ' quux:',<$fh>;
+ }
die $cgi->cgi_error if $cgi->cgi_error;
};
Modified: trunk/Catalyst-Controller-WrapCGI/t/wrap-cgi.t
===================================================================
--- trunk/Catalyst-Controller-WrapCGI/t/wrap-cgi.t 2009-04-29 02:57:29 UTC (rev 9932)
+++ trunk/Catalyst-Controller-WrapCGI/t/wrap-cgi.t 2009-04-29 03:18:26 UTC (rev 9933)
@@ -36,10 +36,11 @@
'Content-Type' => 'text/plain',
Content => 3
],
+ quux => [ undef, quux => Content => 4 ],
],
'Content-Type' => 'form-data';
-is($response->content, 'foo:1 bar:2 baz:3', 'POST with file upload');
+is($response->content, 'foo:1 bar:2 baz:3 quux:4', 'POST with file upload');
$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