[Dancer-users] Bug in Dancer1 (devel branch) - no request->header inside routes

Perlover perlover at perlover.com
Wed Nov 23 12:55:03 CET 2011


I found a bug as i think in Dancer1 -> devel branch

Please take a look at Dancer::Deployment -> Running multiple apps with

           my $app2 = sub {
               my $env = shift;
               local $ENV{DANCER_APPDIR} = '/Users/franck/tmp/app2';
               # 'mount_at' is used to guarantee that the routes of
the applications do
               # not intersect
               load_app "app2", mount_at => "/app2";
               setting appdir => '/Users/franck/tmp/app2';
               my $request = Dancer::Request->new( env => $env );
               ^^^^^^^^^^^^^^ Here $request->{headers} will be undef
because Dancer::SharedData->headers will return undef (my variable
$_headers will be undef)
               ^^^^^^^ Inside here in Dancer::Handler in the sub
handle_request will be initialized $_headers of Dancer::SharedData but
$request object will be keep {headers} as undef

Thus in PSGI variant we will not get any headers through request->header('...')

I can try to make patch for this


More information about the Dancer-users mailing list