X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FWWW.pm;h=d0e20fb54da4a82768d899c53fb693415b759a67;hb=6dec9bf8c0e1b859703d7a5dfb87052cf4e87846;hp=1df5572db61c8a82b217090cbc8e9c27efd9f841;hpb=95a3cace67ff5297e6fc35972e401b7cb17ee310;p=public-inbox.git diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index 1df5572d..d0e20fb5 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -197,7 +197,9 @@ sub news_cgit_fallback ($) { my $www = $ctx->{www}; my $env = $ctx->{env}; my $res = $www->news_www->call($env); - $res->[0] == 404 ? $www->cgit->call($env) : $res; + $res = $www->cgit->call($env) if $res->[0] == 404; + $res = $www->coderepo->srv($ctx) if $res->[0] == 404; + $res; } # returns undef if valid, array ref response if invalid @@ -494,6 +496,14 @@ sub cgit { } } +sub coderepo { + my ($self) = @_; + $self->{coderepo} //= do { + require PublicInbox::WwwCoderepo; + PublicInbox::WwwCoderepo->new($self->{pi_cfg}); + } +} + # GET $INBOX/manifest.js.gz sub get_inbox_manifest ($$$) { my ($ctx, $inbox, $key) = @_;