our $MID_RE = qr!([^/]+)!;
our $END_RE = qr!(T/|t/|t\.mbox(?:\.gz)?|t\.atom|raw|)!;
our $ATTACH_RE = qr!([0-9][0-9\.]*)-($PublicInbox::Hval::FN)!;
-our $OID_RE = qr![a-f0-9]{7,40}!;
+our $OID_RE = qr![a-f0-9]{7,}!;
sub new {
my ($class, $pi_config) = @_;
}
# top-level indices and feeds
- if ($path_info eq '/' || $path_info eq '/manifest.js.gz') {
- www_listing($self)->call($env);
+ if ($path_info eq '/') {
+ require PublicInbox::WwwListing;
+ PublicInbox::WwwListing->response($ctx);
+ } elsif ($path_info eq '/manifest.js.gz') {
+ require PublicInbox::ManifestJsGz;
+ PublicInbox::ManifestJsGz->response($ctx);
} elsif ($path_info =~ m!$INBOX_RE\z!o) {
invalid_inbox($ctx, $1) || r301($ctx, $1);
} elsif ($path_info =~ m!$INBOX_RE(?:/|/index\.html)?\z!o) {
}
$self->cgit;
$self->stylesheets_prepare($_) for ('', '../', '../../');
- $self->www_listing;
$self->news_www;
$pi_config->each_inbox(\&preload_inbox);
}
}
}
-sub www_listing {
- my ($self) = @_;
- $self->{www_listing} ||= do {
- require PublicInbox::WwwListing;
- PublicInbox::WwwListing->new($self);
- }
-}
-
# GET $INBOX/manifest.js.gz
sub get_inbox_manifest ($$$) {
my ($ctx, $inbox, $key) = @_;
my $r404 = invalid_inbox($ctx, $inbox);
return $r404 if $r404;
- require PublicInbox::WwwListing;
- PublicInbox::WwwListing::js($ctx->{env}, [$ctx->{-inbox}]);
+ require PublicInbox::ManifestJsGz;
+ PublicInbox::ManifestJsGz->response($ctx);
}
sub get_attach {