X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=perl%2FSesse%2Fpr0n%2FListing.pm;h=d344083a0518225fcbaf36c8ce4430b0cc89577b;hp=f97a643414677f9ad177a3b5ab0f44ce1586684e;hb=7ed166d00c60530874566d5e67130464e6fc0415;hpb=f9ff3e7edda055056a4de903d4b959f8fa1c2542 diff --git a/perl/Sesse/pr0n/Listing.pm b/perl/Sesse/pr0n/Listing.pm index f97a643..d344083 100644 --- a/perl/Sesse/pr0n/Listing.pm +++ b/perl/Sesse/pr0n/Listing.pm @@ -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)