- foreach my $t (('', 'f/')) {
- test_psgi($app, sub {
- my ($cb) = @_;
- my $path = "/blah%40example.com/$t";
- my $res = $cb->(GET($pfx . $path));
- is(200, $res->code, "success for $path");
- like($res->content, qr!<title>hihi - Me</title>!,
- "HTML returned");
- });
- }
+ test_psgi($app, sub {
+ my ($cb) = @_;
+ my $path = '/blah%40example.com/';
+ my $res = $cb->(GET($pfx . $path));
+ is(200, $res->code, "success for $path");
+ like($res->content, qr!<title>hihi - Me</title>!,
+ "HTML returned");
+
+ $path .= 'f/';
+ $res = $cb->(GET($pfx . $path));
+ is(301, $res->code, "redirect for $path");
+ my $location = $res->header('Location');
+ like($location, qr!/blah%40example\.com/\z!,
+ '/$MESSAGE_ID/f/ redirected to /$MESSAGE_ID/');
+ });
+