### Unstable endpoints
/$LISTNAME/?r=$GIT_COMMIT -> HTML only
-/$LISTNAME/index.atom.xml -> Atom feed
-/$LISTNAME/all.atom.xml -> Atom feed, includes replies
+/$LISTNAME/atom.xml -> Atom feed
### Stable endpoints
/$LISTNAME/m/$MESSAGE_ID.html -> HTML content (short quotes)
link => {
rel => 'self',
href => $feed_opts->{atomurl} ||
- "http://example.com/atom",
+ "http://example.com/atom.xml",
},
id => $feed_opts->{address} || 'public-inbox@example.com',
updated => POSIX::strftime(DATEFMT, gmtime),
my $base = $cgi->url(-base);
$url_base = $cgi_url;
if ($url_base =~ s!/(?:|index\.html)?\z!!) {
- $rv{atomurl} = "$base$url_base/index.atom.xml";
+ $rv{atomurl} = "$base$url_base/atom.xml";
} else {
- $url_base =~ s!/?(?:index|all)\.atom\.xml\z!!;
+ $url_base =~ s!/atom\.xml\z!!;
$rv{atomurl} = $base . $cgi_url;
$url_base = $base . $url_base; # XXX is this needed?
}
} else {
$url_base = "http://example.com";
- $rv{atomurl} = "$url_base/index.atom.xml";
+ $rv{atomurl} = "$url_base/atom.xml";
}
$rv{url} ||= "$url_base/";
$rv{midurl} = "$url_base/m/";
invalid_list(\%ctx, $1) || redirect_list_index(\%ctx, $cgi);
} elsif ($path_info =~ m!$LISTNAME_RE(?:/|/index\.html)?\z!o) {
invalid_list(\%ctx, $1) || get_index(\%ctx, $cgi, 0);
- } elsif ($path_info =~ m!$LISTNAME_RE/index\.atom\.xml\z!o) {
- invalid_list(\%ctx, $1) || get_atom(\%ctx, $cgi, 1);
- } elsif ($path_info =~ m!$LISTNAME_RE/all\.atom\.xml\z!o) {
+ } elsif ($path_info =~ m!$LISTNAME_RE/atom\.xml\z!o) {
invalid_list(\%ctx, $1) || get_atom(\%ctx, $cgi, 0);
# single-message pages
undef;
}
-# /$LISTNAME/index.atom.xml -> Atom feed
-# /$LISTNAME/all.atom.xml -> Atom feed, includes replies
+# /$LISTNAME/atom.xml -> Atom feed, includes replies
sub get_atom {
my ($ctx, $cgi, $top) = @_;
require PublicInbox::Feed;
# atom feeds
{
local $ENV{HOME} = $home;
- my $res = cgi_run("/test/all.atom.xml");
+ my $res = cgi_run("/test/atom.xml");
like($res->{body}, qr/<title>test for public-inbox/,
"set title in XML feed");
like($res->{body},
qr!http://test\.example\.com/test/m/blah%40example\.com!,
"link id set");
like($res->{body}, qr/what\?/, "reply included");
-
- $res = cgi_run("/test/index.atom.xml");
- unlike($res->{body}, qr/what\?/, "reply not included in index");
}
# indices