lib/PublicInbox/WWW.pm | 11 +++++++++++ t/plack.t | 2 ++ t/psgi_v2.t | 3 +++ diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index 3ce7cc2a7b6ddb2ef74616898e60accd3f92b0ae..02b5ded32e9a2950508ef39ef5d7697603eebf1b 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -85,6 +85,8 @@ } elsif ($path_info =~ m!$INBOX_RE/(?:atom\.xml|new\.atom)\z!o) { invalid_inbox($ctx, $1) || get_atom($ctx); } elsif ($path_info =~ m!$INBOX_RE/new\.html\z!o) { invalid_inbox($ctx, $1) || get_new($ctx); + } elsif ($path_info =~ m!$INBOX_RE/description\z!o) { + get_description($ctx, $1); } elsif ($path_info =~ m!$INBOX_RE/(?:(?:git/)?([0-9]+)(?:\.git)?/)? ($PublicInbox::GitHTTPBackend::ANY)\z!ox) { my ($epoch, $path) = ($2, $3); @@ -619,6 +621,15 @@ my $h = [ 'Content-Length', bytes::length($css), 'Content-Type', 'text/css' ]; PublicInbox::GitHTTPBackend::cache_one_year($h); [ 200, $h, [ $css ] ]; +} + +sub get_description { + my ($ctx, $inbox) = @_; + invalid_inbox($ctx, $inbox) || do { + my $d = $ctx->{-inbox}->description . "\n"; + [ 200, [ 'Content-Length', bytes::length($d), + 'Content-Type', 'text/plain' ], [ $d ] ]; + }; } 1; diff --git a/t/plack.t b/t/plack.t index a9a053ed0db420697840707222e2f6f2f4ace779..e23658fd3003d56d06acc887dd6c9effd272096e 100644 --- a/t/plack.t +++ b/t/plack.t @@ -189,6 +189,8 @@ 'atom feed generated correct URL'); like($body, qr/