diff options
author | Eric Wong <e@80x24.org> | 2016-07-02 07:56:38 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-07-02 07:57:29 +0000 |
commit | 193e9a586d49fb111fd201f491b1ad0be4e386b3 (patch) | |
tree | 02d5d074777dce9a2557d59622841cc7754c49f0 /lib/PublicInbox/Feed.pm | |
parent | 2375cc488f2b1ea314452067a196a576558f7b57 (diff) | |
download | public-inbox-193e9a586d49fb111fd201f491b1ad0be4e386b3.tar.gz |
Lighter and ever-so-slightly faster! Most importantly, this won't do non-obvious stuff behind our backs like trying to parse a POST request body for a query string param.
Diffstat (limited to 'lib/PublicInbox/Feed.pm')
-rw-r--r-- | lib/PublicInbox/Feed.pm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index ffbf5c80..2983514c 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -119,17 +119,18 @@ sub end_feed { sub emit_atom_thread { my ($cb, $ctx) = @_; - my $res = $ctx->{srch}->get_thread($ctx->{mid}); + my $mid = $ctx->{mid}; + my $res = $ctx->{srch}->get_thread($mid); return _no_thread($cb) unless $res->{total}; my $feed_opts = get_feedopts($ctx); my $fh = $cb->([200, ['Content-Type' => 'application/atom+xml']]); + my $ibx = $ctx->{-inbox}; + my $html_url = $ibx->base_url($ctx->{env}); + $html_url .= PublicInbox::Hval->new_msgid($mid)->as_href; - my $html_url = $feed_opts->{atomurl} = $ctx->{self_url}; - $html_url =~ s!/t\.atom\z!/!; $feed_opts->{url} = $html_url; $feed_opts->{emit_header} = 1; - my $ibx = $ctx->{-inbox}; foreach my $msg (@{$res->{msgs}}) { my $s = feed_entry($feed_opts, mid2path($msg->mid), $ibx); $fh->write($s) if defined $s; |