about summary refs log tree commit homepage
path: root/lib/PublicInbox/WwwAtomStream.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-09-10 20:10:23 +0000
committerEric Wong <e@80x24.org>2022-09-11 19:25:46 +0000
commitf5e2daa70e0a1a75d1220d84193f3eeebb799c38 (patch)
treef5a5a8bcf8982ab5b025f8070011e099eeb55cab /lib/PublicInbox/WwwAtomStream.pm
parent12900fecdc4c7f577eb8266a2334d74f72fd2518 (diff)
downloadpublic-inbox-f5e2daa70e0a1a75d1220d84193f3eeebb799c38.tar.gz
For redundant messages sharing Message-IDs, the link to solver
(/$INBOX/$OID/s/) was going up too many levels for /$INBOX/$MSGID/
when there were multiple messages sharing the same $MSGID.

Unfortunately, redundant messages are common with /all/
due to signature trailers.  So dynamically assigning {-spfx}
is tricky and error prone from counting `/'.

So simplify the code a bit by setting {-spfx} once per HTTP
request, instead of every single message.
Diffstat (limited to 'lib/PublicInbox/WwwAtomStream.pm')
-rw-r--r--lib/PublicInbox/WwwAtomStream.pm1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/PublicInbox/WwwAtomStream.pm b/lib/PublicInbox/WwwAtomStream.pm
index 33da3244..83a8818e 100644
--- a/lib/PublicInbox/WwwAtomStream.pm
+++ b/lib/PublicInbox/WwwAtomStream.pm
@@ -16,6 +16,7 @@ use PublicInbox::MsgTime qw(msg_timestamp);
 sub new {
         my ($class, $ctx, $cb) = @_;
         $ctx->{feed_base_url} = $ctx->{ibx}->base_url($ctx->{env});
+        $ctx->{-spfx} = $ctx->{feed_base_url} if $ctx->{ibx}->{coderepo};
         $ctx->{cb} = $cb || \&PublicInbox::GzipFilter::close;
         $ctx->{emit_header} = 1;
         bless $ctx, $class;