]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WwwCoderepo.pm
www_coderepo: implement /$CODE_REPO/atom/ endpoint
[public-inbox.git] / lib / PublicInbox / WwwCoderepo.pm
index 1a8754c44fd816f21efb87a485ef894a30952be0..3c9292226b964857b6c9a12337c057f598fd2614 100644 (file)
@@ -16,6 +16,7 @@ use PublicInbox::GitAsyncCat;
 use PublicInbox::WwwStream;
 use PublicInbox::Hval qw(ascii_html);
 use PublicInbox::RepoSnapshot;
+use PublicInbox::RepoAtom;
 
 my $EACH_REF = "git for-each-ref --sort=-creatordate --format='%(HEAD)%00".
        join('%00', map { "%($_)" }
@@ -227,6 +228,11 @@ sub srv { # endpoint called by PublicInbox::WWW
                return PublicInbox::RepoSnapshot::srv($ctx, $2) // r(404);
        }
 
+       if ($path_info =~ m!\A/(.+?)/atom/(.*)\z! and
+                       ($ctx->{git} = $self->{"\0$1"})) {
+               return PublicInbox::RepoAtom::srv_atom($ctx, $2) // r(404);
+       }
+
        # enforce trailing slash:
        if ($path_info =~ m!\A/(.+?)\z! and ($git = $self->{"\0$1"})) {
                my $qs = $ctx->{env}->{QUERY_STRING};