use constant CGI => "blib/script/public-inbox.cgi";
my $mda = "blib/script/public-inbox-mda";
my $index = "blib/script/public-inbox-index";
-my $tmpdir = tempdir(CLEANUP => 1);
+my $tmpdir = tempdir('pi-cgi-XXXXXX', TMPDIR => 1, CLEANUP => 1);
my $home = "$tmpdir/pi-home";
my $pi_home = "$home/.public-inbox";
my $pi_config = "$pi_home/config";
like($res->{head}, qr/Status: 300 Multiple Choices/, "mid html miss");
$res = cgi_run("/test/blahblah\@example.com/f/");
- like($res->{body}, qr/\A<html>/, "mid html");
- like($res->{head}, qr/Status: 200 OK/, "200 response");
- $res = cgi_run("/test/blahblah\@example.con/f/");
+ like($res->{head}, qr/Status: 301 Moved/, "301 response");
+ like($res->{head},
+ qr!^Location: http://[^/]+/test/blahblah%40example\.com/\r\n!ms,
+ '301 redirect location');
+ $res = cgi_run("/test/blahblah\@example.con/");
like($res->{head}, qr/Status: 300 Multiple Choices/, "mid html miss");
$res = cgi_run("/test/");