[Catalyst] + in GET param

Tatsuhiko Miyagawa miyagawa at gmail.com
Wed Sep 12 03:54:51 GMT 2007


I tested but couldn't reproduce. So I wouldn't say this is a Cat bug.

% catalyst.pl TestApp
% cd TestApp
% vi lib/TestApp/Controller/Root.pm

sub default : Private {
    my ( $self, $c ) = @_;

    # Hello World
    $c->response->body("Hello " . ($c->req->param('username') || "(default)"));
}

% ./script/testapp_server.pl

Access http://localhost:3000/?username=first.last%2Bme%40gmail.com

It prints out "Hello first.last+me at gmail.com".

[info] *** Request 1 (0.167/s) [1194] [Tue Sep 11 19:54:11 2007] ***
[debug] Query Parameters are:
.-------------------------------------+--------------------------------------.
| Parameter                           | Value                                |
+-------------------------------------+--------------------------------------+
| username                            | first.last+me at gmail.com              |
'-------------------------------------+--------------------------------------'
[debug] "GET" request for "/" from "192.168.70.1"
[info] Request took 0.068512s (14.596/s)
.----------------------------------------------------------------+-----------.
| Action                                                         | Time      |
+----------------------------------------------------------------+-----------+
| /default                                                       | 0.000100s |
| /end                                                           | 0.000818s |
'----------------------------------------------------------------+-----------'

Check Catalyst::Engine versions or whatever plugins you use that
messes something with request parameters?


On 9/11/07, Gavin Henry <ghenry at perl.me.uk> wrote:
> >> Looks like it is a problem with the debug printing code or the some
> >> unescape code somewhere.  That is the proper escape for +.
> >
> > Yes. and the problem is Catalyst is unescaping it to early, so its
> > seeing it as a literal +, which then gets converted to a space according
> > to the HTTP RFC. It shouldn't. There is a bug in the catalyst param
> > handling somewhere I suspect.
> >
>
> Ok, so it's a bug in Catalyst. I'll dig in Catalyst::Request which in
> turn uses URI::QueryParam and URI. Maybe something there.
>
> Gavin.
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>


-- 
Tatsuhiko Miyagawa



More information about the Catalyst mailing list