]> Sergey Matveev's repositories - public-inbox.git/commitdiff
feed: avoid redirect on permalink
authorEric Wong <e@80x24.org>
Mon, 28 Apr 2014 20:04:44 +0000 (20:04 +0000)
committerEric Wong <e@80x24.org>
Mon, 28 Apr 2014 20:09:11 +0000 (20:09 +0000)
This saves one round-trip request response so reduces latency over
slow links.  The redirect only exists for convenience and isn't 100%
reliable in case the Message-ID terminates with a .(html|txt)
suffix.

lib/PublicInbox/Feed.pm

index 1c6d1efd6aa0e6f8ef5d11c3eb1b9899e4c5dbd7..0a08c7f2b6a0bb008fb25cce8b69951707d2d53d 100644 (file)
@@ -243,9 +243,8 @@ sub add_to_feed {
        my $mid = $mime->header_obj->header_raw('Message-ID');
        defined $mid or return 0;
        $mid = PublicInbox::Hval->new_msgid($mid);
-       my $href = $mid->as_href;
-       my $content = PublicInbox::View->as_feed_entry($mime,
-                                                       "$fullurl$href.html");
+       my $href = $mid->as_href . '.html';
+       my $content = PublicInbox::View->as_feed_entry($mime, $fullurl . $href);
        defined($content) or return 0;
 
        my $subject = mime_header($mime, 'Subject') or return 0;