bigpresh / Dancer-Plugin-Database

Dancer::Plugin::Database - easy database support for Dancer applications
http://search.cpan.org/dist/Dancer-Plugin-Database
37 stars 36 forks source link

'forward' produces a Perl error if parameters are present in the URL #4

Closed NickHibma closed 13 years ago

NickHibma commented 13 years ago

'forward' produces an error if you request

    http://localhost:3000/?prm=1

The error is:

    Can't use string ("prm") as a HASH ref while "strict refs" in use at /opt/local/lib/perl5/site_perl/5.10.1/Dancer/Request.pm line 91.

Create the app like so:

    dancer -a Bla
    cat > lib/Bla.pm <<EOF
    package Bla;
    use Dancer ':syntax';

    our $VERSION = '0.1';

    get '/' => sub {
        forward '/bla';
    };

    get '/bla' => sub {
        template 'index';
    };

    true;
    EOF
NickHibma commented 13 years ago

Eh, this issue should be moved to Dancer instead ... Including the solution:

nick@hillary:/opt/local/lib/perl5/site_perl/5.10.1 % diff -wu Dancer/Route.pm{~,} --- Dancer/Route.pm~ 2011-02-05 23:14:22.000000000 +0100 +++ Dancer/Route.pm 2011-02-05 23:09:37.000000000 +0100 @@ -159,7 +159,7 @@ my $new_req = Dancer::Request->new_for_request( $request->method, $response->{forward},

NickHibma commented 13 years ago

Added there.