[Dancer-users] Possible Dancer::Plugin::Ajax bug

Dave Seleno dave at instantchannelinc.com
Fri Aug 5 04:54:52 CEST 2011


In my Dancer application, I have three different handlers for the same path, based on the request method:

ajax '/some_path' => sub {
  ...
  return to_json({...}) ;
}

post '/some_path' => sub {
  ...
  return redirect '/some_path' ;
}

get '/some_path' => sub {
  ...
  return template 'some/template' => {
    ...
  } ;
}

What I am seeing is that, occasionally and with no pattern I've yet been able to reproduce, when a GET is issued to /some_path, the process is handled by the correct GET handler, but the response comes back without the layout. There are no errors in the log. From the documentation of Dancer::Plugin::Ajax, disabling the layout is what one would expect only when the AJAX handler was triggered. Issuing another GET immediately after typically "fixes" the problem and the response comes back with the layout intact.

Has anyone else experienced this?

Regards,
Dave


More information about the Dancer-users mailing list