X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=perl%2FSesse%2Fpr0n%2FListing.pm;fp=perl%2FSesse%2Fpr0n%2FListing.pm;h=d344083a0518225fcbaf36c8ce4430b0cc89577b;hb=2eb22a8cf072d004c98fbdafaba2d7f1b6801f50;hp=f97a643414677f9ad177a3b5ab0f44ce1586684e;hpb=0ffcbe4f423912233b76c5281126d7367653a63d;p=pr0n 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)