[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


Hello,

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

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

           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";
               Dancer::App->set_running_app('app2');
               setting appdir => '/Users/franck/tmp/app2';
               Dancer::Config->load;
               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)
               Dancer->dance($request);
               ^^^^^^^ 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

Perlover


More information about the Dancer-users mailing list