in reply to Help me understand Catalyst routing, or do I mean Actions?
One of the powerful features of Catalyst is the great degree of "hooking" that you can do at all phases of handling the request. The downside is that a lot of the flow control of the application becomes hidden and makes a learning curve for the maintenance developer. A developer or plugin author might decide to make POST requests opt-in rather than manually switching inside of each action, or something like that. Your challenge is to find out where that happened.
First, check all the plugins loaded at the top level
and read their CPAN documentation.use Catalyst qw/ PLUGIN1 PLUGIN2 PLUGIN3 ... /;
Then, check for the base class of the controller.
Sometimes a project might also have a 'MyApp::Controller' base class used for all controllers where the author sets up the defaults they want to use for the project.use Moose; extends 'Catalyst::Controller'; # normal # vs... extends 'Catalyst::Controller::REST'; # changes behavior of things
Check for the 'begin' and 'end' actions:
or something more deliberate:sub begin :SOME_MAGIC_ATTRIBUTE {}
sub begin { my ($self, $c)= @_; if ($c->req->method ne 'GET') { $c->res->code(404); $c->detch; }
Then, check for behaviors of a parent controller, such as the root controller:
and any controller in the filesystem hierarchy leading to the one that is giving you problems.package MyApp::Controller::Root; sub begin { ... }
You can also put debug statements in each of the begin/end places to help log what is going on.
Hope that helps.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help me understand Catalyst routing, or do I mean Actions?
by Cody Fendant (Hermit) on Jun 15, 2022 at 05:21 UTC |