[Catalyst-commits] r7996 - in Catalyst-Runtime/5.70/trunk: .
lib/Catalyst t
bricas at dev.catalyst.perl.org
bricas at dev.catalyst.perl.org
Tue Jun 24 01:14:21 BST 2008
Author: bricas
Date: 2008-06-24 01:14:21 +0100 (Tue, 24 Jun 2008)
New Revision: 7996
Modified:
Catalyst-Runtime/5.70/trunk/Changes
Catalyst-Runtime/5.70/trunk/lib/Catalyst/Engine.pm
Catalyst-Runtime/5.70/trunk/t/live_engine_request_parameters.t
Log:
remove 0-length query string components so warnings aren't thrown (RT #36428)
Modified: Catalyst-Runtime/5.70/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.70/trunk/Changes 2008-06-23 22:01:06 UTC (rev 7995)
+++ Catalyst-Runtime/5.70/trunk/Changes 2008-06-24 00:14:21 UTC (rev 7996)
@@ -1,6 +1,7 @@
# This file documents the revision history for Perl extension Catalyst.
5.7xxx xxx
+ - remove 0-length query string components so warnings aren't thrown (RT #36428)
- Update HTTP::Body dep so that the uploadtmp config value will work (RT #22540)
- Fix for LocalRegex when used in the Root controller
- Get some of the optional_* tests working from dirs with spaces (RT #26455)
Modified: Catalyst-Runtime/5.70/trunk/lib/Catalyst/Engine.pm
===================================================================
--- Catalyst-Runtime/5.70/trunk/lib/Catalyst/Engine.pm 2008-06-23 22:01:06 UTC (rev 7995)
+++ Catalyst-Runtime/5.70/trunk/lib/Catalyst/Engine.pm 2008-06-24 00:14:21 UTC (rev 7996)
@@ -452,7 +452,7 @@
# replace semi-colons
$query_string =~ s/;/&/g;
- my @params = split /&/, $query_string;
+ my @params = grep { length $_ } split /&/, $query_string;
for my $item ( @params ) {
Modified: Catalyst-Runtime/5.70/trunk/t/live_engine_request_parameters.t
===================================================================
--- Catalyst-Runtime/5.70/trunk/t/live_engine_request_parameters.t 2008-06-23 22:01:06 UTC (rev 7995)
+++ Catalyst-Runtime/5.70/trunk/t/live_engine_request_parameters.t 2008-06-24 00:14:21 UTC (rev 7996)
@@ -6,7 +6,7 @@
use FindBin;
use lib "$FindBin::Bin/lib";
-use Test::More tests => 40;
+use Test::More tests => 53;
use Catalyst::Test 'TestApp';
use Catalyst::Request;
@@ -137,3 +137,26 @@
ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' );
is( $creq->{uri}->query, 'x=1&y=1&z=1', 'Catalyst::Request GET query_string' );
}
+
+{
+ my $creq;
+ ok( my $response = request("http://localhost/dump/request?&&q="),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ ok( eval '$creq = ' . $response->content );
+ is( keys %{$creq->{parameters}}, 1, 'remove empty parameter' );
+ is( $creq->{parameters}->{q}, '', 'empty parameter' );
+}
+
+{
+ my $creq;
+ ok( my $response = request("http://localhost/dump/request?&0&q="),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ ok( eval '$creq = ' . $response->content );
+ is( keys %{$creq->{parameters}}, 2, 'remove empty parameter' );
+ is( $creq->{parameters}->{q}, '', 'empty parameter' );
+ ok( !defined $creq->{parameters}->{0}, 'empty parameter' );
+}
More information about the Catalyst-commits
mailing list