+ my $pfx = 'http://example.com/test';
+ foreach my $t (qw(t T)) {
+ test_psgi($app, sub {
+ my ($cb) = @_;
+ my $u = $pfx . "/blah\@example.com/$t";
+ my $res = $cb->(GET($u));
+ is(301, $res->code, "redirect for missing /");
+ my $location = $res->header('Location');
+ like($location, qr!/\Q$t\E/#u\z!,
+ 'redirected with missing /');
+ });
+ }
+ foreach my $t (qw(f)) {
+ test_psgi($app, sub {
+ my ($cb) = @_;
+ my $u = $pfx . "/blah\@example.com/$t";
+ my $res = $cb->(GET($u));
+ is(301, $res->code, "redirect for legacy /f");
+ my $location = $res->header('Location');
+ like($location, qr!/blah\@example\.com/\z!,
+ 'redirected with missing /');
+ });
+ }
+