[Catalyst-commits] r10293 - in
Catalyst-Runtime/5.80/branches/decode-chained-args:
lib/Catalyst/DispatchType t/aggregate
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Tue May 26 15:52:38 GMT 2009
Author: caelum
Date: 2009-05-26 15:52:37 +0000 (Tue, 26 May 2009)
New Revision: 10293
Modified:
Catalyst-Runtime/5.80/branches/decode-chained-args/lib/Catalyst/DispatchType/Chained.pm
Catalyst-Runtime/5.80/branches/decode-chained-args/t/aggregate/live_component_controller_action_chained.t
Log:
URI-decode chained args
Modified: Catalyst-Runtime/5.80/branches/decode-chained-args/lib/Catalyst/DispatchType/Chained.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/decode-chained-args/lib/Catalyst/DispatchType/Chained.pm 2009-05-26 15:05:07 UTC (rev 10292)
+++ Catalyst-Runtime/5.80/branches/decode-chained-args/lib/Catalyst/DispatchType/Chained.pm 2009-05-26 15:52:37 UTC (rev 10293)
@@ -151,8 +151,14 @@
my @parts = split('/', $path);
my ($chain, $captures, $parts) = $self->recurse_match($c, '/', \@parts);
- push @{$request->args}, @$parts if $parts && @$parts;
+ if ($parts && @$parts) {
+ for my $arg (@$parts) {
+ $arg =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
+ push @{$request->args}, $arg;
+ }
+ }
+
return 0 unless $chain;
my $action = Catalyst::ActionChain->from_chain($chain);
Modified: Catalyst-Runtime/5.80/branches/decode-chained-args/t/aggregate/live_component_controller_action_chained.t
===================================================================
--- Catalyst-Runtime/5.80/branches/decode-chained-args/t/aggregate/live_component_controller_action_chained.t 2009-05-26 15:05:07 UTC (rev 10292)
+++ Catalyst-Runtime/5.80/branches/decode-chained-args/t/aggregate/live_component_controller_action_chained.t 2009-05-26 15:52:37 UTC (rev 10293)
@@ -1009,7 +1009,6 @@
ok( my $content =
get('http://localhost/chained/return_arg/foo%2Fbar%3B'),
'request with URI-encoded arg' );
- # this is the CURRENT behavior
- like( $content, qr{foo%2Fbar%3B\z}, 'args NOT decoded' );
+ like( $content, qr{foo/bar;\z}, 'args decoded' );
}
}
More information about the Catalyst-commits
mailing list