[Catalyst] Path is "/"

Nick catalyst at acrasis.net
Tue Sep 6 14:12:02 GMT 2011


On 2011-09-06 14:47, Tomas Doran wrote:
> This is due to you mixing path and chained actions. The path actions
> take higher priority if they're able to match at all..
>
> > [debug] Loaded Path actions:
> > .-------------------------------------+--------------------------------------.
> > | Path                                | Private
> >|
> > +-------------------------------------+--------------------------------------+
> > | /                                   | /index
> >|
> > | /...                                | /default
>
> Try changing this to sub default : Chained('/') Args()

Like this -

   sub default :Chained('/') :Args() {..}

- in the Root controller?  Sadly, it did not help, the default action
still runs.

I put a debug message into Catalyst::Dispatcher and it reports

  [debug] "GET" request for "login/124/audit_log" from "127.0.0.1"
  [debug] Catalyst::DispatchType::Index matches 'login/124/audit_log'? 0
  [debug] Catalyst::DispatchType::Path matches 'login/124/audit_log'? 0
  [debug] Catalyst::DispatchType::Regex matches 'login/124/audit_log'? 0
  [debug] Catalyst::DispatchType::Chained matches 'login/124/audit_log'? 0
  [debug] Catalyst::DispatchType::Default matches 'login/124/audit_log'? 0
  [debug] Catalyst::DispatchType::Index matches 'login/124'? 0
  [debug] Catalyst::DispatchType::Path matches 'login/124'? 0
  [debug] Catalyst::DispatchType::Regex matches 'login/124'? 0
  [debug] Catalyst::DispatchType::Chained matches 'login/124'? 0
  [debug] Catalyst::DispatchType::Default matches 'login/124'? 0
  [debug] Catalyst::DispatchType::Index matches 'login'? 0
  [debug] Catalyst::DispatchType::Path matches 'login'? 0
  [debug] Catalyst::DispatchType::Regex matches 'login'? 0
  [debug] Catalyst::DispatchType::Chained matches 'login'? 0
  [debug] Catalyst::DispatchType::Default matches 'login'? 0
  [debug] Catalyst::DispatchType::Index matches ''? 0
  [debug] Catalyst::DispatchType::Path matches ''? 0
  [debug] Catalyst::DispatchType::Regex matches ''? 0
  [debug] Catalyst::DispatchType::Chained matches ''? 0
  [debug] Catalyst::DispatchType::Default matches ''? 1
  [debug] Arguments are "login/124/audit_log"

(The 0 or 1 at the end is whether the dispatcher reported a match.)

If I understand correctly, the full path is being considered fairly
early in the matching process, as a chained action, and is rejected.
But I do not see why.

--
Nick




More information about the Catalyst mailing list