use Encode qw(decode_utf8);
use PublicInbox::Config;
use Digest::SHA qw(sha1_hex);
-our $LISTNAME_RE = qr!\A/([\w\.\-]+)!;
+our $LISTNAME_RE = qr!\A(?:/.*?)?/([\w\.\-]+)!;
our $pi_config;
BEGIN {
$pi_config = PublicInbox::Config->new;
if ($cgi->request_method !~ /\AGET|HEAD\z/) {
return r("405 Method Not Allowed");
}
- my $path_info = decode_utf8($ENV{PATH_INFO});
+ my $path_info = decode_utf8($cgi->path_info);
# top-level indices and feeds
if ($path_info eq "/") {
r404();
- } elsif ($path_info =~ m!$LISTNAME_RE(?:/|/index\.html)?\z!o) {
+ } elsif ($path_info =~ m!$LISTNAME_RE/(?:index\.html)?\z!o) {
invalid_list(\%ctx, $1) || get_index(\%ctx, $cgi, 1);
} elsif ($path_info =~ m!$LISTNAME_RE/index\.atom\.xml\z!o) {
invalid_list(\%ctx, $1) || get_atom(\%ctx, $cgi, 1);