Dancer2 icon indicating copy to clipboard operation
Dancer2 copied to clipboard

add_route called in a plugin BUILD block will get a prefix that cannot be overridden

Open GeekRuthie opened this issue 3 years ago • 1 comments

In Dancer2::Core::App::add_route, putting the prefix => option (line 1230) above the attrs that are given by the caller will let the caller override the prefix.

If you attempt to use $self->app->add_route in a plugin's BUILD block, and your application uses prefixes, it'll probably get one, likely the last prefix statement in your load order, and adding prefix => undef to your add_route call doesn't help.

GeekRuthie avatar Apr 19 '22 00:04 GeekRuthie

Note: I've got a patch for this coming, just adding some tests to t/app.pl to test that it works correctly. :smiley:

GeekRuthie avatar May 14 '22 15:05 GeekRuthie