about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2014-04-14 07:53:53 +0000
committerEric Wong <e@80x24.org>2014-04-14 08:04:12 +0000
commit513defd67b678c8b8f2ab571e44d20a30b49c6f8 (patch)
treed1f7cd1ca4ae8a23476996e61b42abc39957989c /t
parent4e519086a895d161df658c7d5028dafbb4cfb30f (diff)
downloadpublic-inbox-513defd67b678c8b8f2ab571e44d20a30b49c6f8.tar.gz
It is common to type upper-level URLs without the slash,
redirect users to the correct page for usability.
Diffstat (limited to 't')
-rw-r--r--t/cgi.t8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/cgi.t b/t/cgi.t
index ae7cc730..c8755541 100644
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -181,6 +181,14 @@ EOF
                 "slashy URL generated correctly");
 }
 
+# redirect list-name-only URLs
+{
+        local $ENV{HOME} = $home;
+        my $res = cgi_run("/test");
+        like($res->{head}, qr/Status: 301 Moved/, "redirected status");
+        like($res->{head}, qr!/test/!, "redirected with slash");
+}
+
 done_testing();
 
 sub run_with_env {