[Catalyst-commits] r10295 - in Catalyst-Runtime/5.80/branches/decode-chained-args/t: aggregate lib/TestApp/Controller/Action

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Tue May 26 18:25:53 GMT 2009


Author: t0m
Date: 2009-05-26 18:25:52 +0000 (Tue, 26 May 2009)
New Revision: 10295

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/lib/TestApp/Controller/Action/Chained.pm
Log:
All works fine if you were already decoding manually. If you rely on double encoded values in your path parts then please come convince me how that is sane as I think ur doin it wrong..

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 16:07:16 UTC (rev 10294)
+++ Catalyst-Runtime/5.80/branches/decode-chained-args/t/aggregate/live_component_controller_action_chained.t	2009-05-26 18:25:52 UTC (rev 10295)
@@ -10,7 +10,7 @@
 
 BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
 
-use Test::More tests => 145*$iters;
+use Test::More tests => 147*$iters;
 use Catalyst::Test 'TestApp';
 
 if ( $ENV{CAT_BENCHMARK} ) {
@@ -1011,4 +1011,11 @@
             'request with URI-encoded arg' );
         like( $content, qr{foo/bar;\z}, 'args decoded' );
     }
+    {
+        ok( my $content =
+            get('http://localhost/chained/return_arg_decoded/foo%2Fbar%3B'),
+            'request with URI-encoded arg' );
+        like( $content, qr{foo/bar;\z}, 'args decoded' );
+    }
 }
+

Modified: Catalyst-Runtime/5.80/branches/decode-chained-args/t/lib/TestApp/Controller/Action/Chained.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/decode-chained-args/t/lib/TestApp/Controller/Action/Chained.pm	2009-05-26 16:07:16 UTC (rev 10294)
+++ Catalyst-Runtime/5.80/branches/decode-chained-args/t/lib/TestApp/Controller/Action/Chained.pm	2009-05-26 18:25:52 UTC (rev 10295)
@@ -3,6 +3,8 @@
 use strict;
 use warnings;
 
+use HTML::Entities;
+
 use base qw/Catalyst::Controller/;
 
 sub begin :Private { }
@@ -196,7 +198,12 @@
 sub doc_star : Chained('/') PathPart('chained/doc') Args(1) {}
 
 sub return_arg : Chained('/') PathPart('chained/return_arg') Args(1) {}
+sub return_arg_decoded : Chained('/') PathPart('chained/return_arg_decoded') Args(1) {
+    my ($self, $c) = @_;
+    $c->req->args([ map { decode_entities($_) } @{ $c->req->args }]);
+}
 
+
 sub end :Private {
   my ($self, $c) = @_;
   return if $c->stash->{no_end};




More information about the Catalyst-commits mailing list