X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FWWW.pm;h=d0e20fb54da4a82768d899c53fb693415b759a67;hb=6dec9bf8c0e1b859703d7a5dfb87052cf4e87846;hp=a33709e96fc918867ed9f7a05623f19e29597a03;hpb=74a504208be624c438cbdec955d5eacace29d626;p=public-inbox.git diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index a33709e9..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 @@ -303,7 +305,8 @@ sub get_text { sub get_vcs_object ($$$;$) { my ($ctx, $inbox, $oid, $filename) = @_; my $r404 = invalid_inbox($ctx, $inbox); - return $r404 if $r404 || !$ctx->{www}->{pi_cfg}->repo_objs($ctx->{ibx}); + return $r404 if $r404; + return r(404) if !$ctx->{www}->{pi_cfg}->repo_objs($ctx->{ibx}); require PublicInbox::ViewVCS; PublicInbox::ViewVCS::show($ctx, $oid, $filename); } @@ -319,7 +322,7 @@ sub get_altid_dump { sub need { my ($ctx, $extra) = @_; require PublicInbox::WwwStream; - PublicInbox::WwwStream::html_oneshot($ctx, 501, \<$extra is not available for this public-inbox Return to index EOF @@ -493,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) = @_;