From 513defd67b678c8b8f2ab571e44d20a30b49c6f8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 14 Apr 2014 07:53:53 +0000 Subject: cgi: 301 for list-indices without trailing slash It is common to type upper-level URLs without the slash, redirect users to the correct page for usability. --- t/cgi.t | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 't') 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 { -- cgit v1.2.3-24-ge0c7