PerlDancer / Dancer2

Perl Dancer Next Generation (rewrite of Perl Dancer)
http://perldancer.org/
Other
543 stars 273 forks source link

redirect disregards path to app #1564

Closed nfg closed 3 years ago

nfg commented 3 years ago

Hey!

The redirect function has stopped respecting the path leading to the Dancer2 app. If my PSGI looks something like

use strict;
use warnings;
use lib qw<lib>;

use Plack::Builder;

use MainApp;
use SubApp;

builder {
    mount '/' => MainApp->to_app();
    mount '/subapp' => SubApp->to_app();
};

Then redirect "/page" in MainApp works fine, but redirect "/page" in SubApp goes to /page instead of /subapp/page.

This changed in #1461 . I can fix this on my end by finding everywhere I call redirect and calling uri_for first, but it's unexpected behaviour.

Cheers!

cromedome commented 3 years ago

Resolved by #1565. Thanks for reporting!