about summary refs log tree commit homepage
path: root/lib/PublicInbox/Feed.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/Feed.pm')
-rw-r--r--lib/PublicInbox/Feed.pm9
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;