From: Tomas Doran Date: Tue, 26 May 2009 18:25:52 +0000 (+0000) Subject: All works fine if you were already decoding manually. If you rely on double encoded... X-Git-Tag: 5.80005~24^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=372b0c1b8751c29e542dbc7624f11b8c99ef5742 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.. --- diff --git a/t/aggregate/live_component_controller_action_chained.t b/t/aggregate/live_component_controller_action_chained.t index 5adf520..9d83176 100644 --- a/t/aggregate/live_component_controller_action_chained.t +++ b/t/aggregate/live_component_controller_action_chained.t @@ -10,7 +10,7 @@ our $iters; 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 @@ sub run_tests { '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' ); + } } + diff --git a/t/lib/TestApp/Controller/Action/Chained.pm b/t/lib/TestApp/Controller/Action/Chained.pm index c3c85fe..051961c 100644 --- a/t/lib/TestApp/Controller/Action/Chained.pm +++ b/t/lib/TestApp/Controller/Action/Chained.pm @@ -3,6 +3,8 @@ package TestApp::Controller::Action::Chained; use strict; use warnings; +use HTML::Entities; + use base qw/Catalyst::Controller/; sub begin :Private { } @@ -196,6 +198,11 @@ sub star_search : Chained('view') PathPart('search') Args(0) { } 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) = @_;