diff options
author | Eric Wong <e@80x24.org> | 2020-09-09 06:26:16 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2020-09-10 19:45:18 +0000 |
commit | f303b4add8ea18835f7f304910ba8fac3ee4f912 (patch) | |
tree | 037efb9de87e44433b18d535b4ed5fec03fa211b /lib/PublicInbox/WWW.pm | |
parent | 081946eae235baac51987cf591e2b55e7e039b55 (diff) | |
download | public-inbox-f303b4add8ea18835f7f304910ba8fac3ee4f912.tar.gz |
By using the just-introduced ConfigIter class. And make ManifestJsGz a subclass of it to reduce duplication.
Diffstat (limited to 'lib/PublicInbox/WWW.pm')
-rw-r--r-- | lib/PublicInbox/WWW.pm | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index 93ab3c9d..85abf327 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -77,8 +77,12 @@ sub call { } # 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) { @@ -171,7 +175,6 @@ sub preload { } $self->cgit; $self->stylesheets_prepare($_) for ('', '../', '../../'); - $self->www_listing; $self->news_www; $pi_config->each_inbox(\&preload_inbox); } @@ -496,21 +499,13 @@ sub cgit { } } -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::ManifestJsGz; - PublicInbox::ManifestJsGz::response($ctx->{env}, [$ctx->{-inbox}]); + PublicInbox::ManifestJsGz->response($ctx); } sub get_attach { |