]> git.sesse.net Git - pr0n/blobdiff - perl/Sesse/pr0n/Listing.pm
Allow () in filenames.
[pr0n] / perl / Sesse / pr0n / Listing.pm
index f97a643414677f9ad177a3b5ab0f44ce1586684e..d344083a0518225fcbaf36c8ce4430b0cc89577b 100644 (file)
@@ -17,6 +17,12 @@ sub handler {
                }
        }
        
+       # Fix common error: pr0n.sesse.net/+foo -> pr0n.sesse.net/+foo/
+       if ($r->uri !~ /\/$/) {
+               $r->headers_out->{'location'} = $r->uri . "/";
+               return Apache2::Const::REDIRECT;
+       }
+       
        # find the last modification
        my $ref = $dbh->selectrow_hashref('SELECT EXTRACT(EPOCH FROM last_update) AS last_update FROM events WHERE vhost=? ORDER BY last_update DESC LIMIT 1',
                undef, $r->get_server_name)