We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#!/usr/bin/env perl use Mojo::Base -strict; use Test::More 'no_plan'; use Mojolicious; use Test::Mojo; sub e_app { # Embedded app my $eapp = Mojolicious->new(); my $r = $eapp->routes; # !Stash $r->route('/foo')->route('')->to(fe => 'beee'); $r->route('/foo/welcome')->to( cb => sub { my $self = shift; # stash must be empty, because '/foo' isn't our parent my $fe = $self->stash('fe') || ''; $self->render_text("hello$fe"); } ); return $eapp; } sub p_app { # Parent app with embedded on /emb my $app = Mojolicious->new(); $app->routes->route('/emb')->detour(e_app()); return $app; } my $EXPECT = 'hello'; # /foo/welcome route in e_app, p_app is our proxy. BAD!!! Test::Mojo->new()->app(p_app)->get_ok("/emb/foo/welcome") ->content_is($EXPECT); # /foo/welcome route in e_app directly. GOOD Test::Mojo->new()->app(e_app)->get_ok("/foo/welcome")->content_is($EXPECT);
The text was updated successfully, but these errors were encountered:
The main problem is when we have
$r->route('/')->to(cb => sub { ... });
All other routers became broken
Sorry, something went wrong.
be9521d
Thanks for the clean test case, made it very easy to fix the bug. :)
No branches or pull requests
The text was updated successfully, but these errors were encountered: