]> Sergey Matveev's repositories - public-inbox.git/commitdiff
cgi: fix up top-level index
authorEric Wong <e@80x24.org>
Mon, 14 Apr 2014 07:58:50 +0000 (07:58 +0000)
committerEric Wong <e@80x24.org>
Mon, 14 Apr 2014 08:04:16 +0000 (08:04 +0000)
We do not have all messages in the top-level index
(and we need to adjust the test while we're at it).

lib/PublicInbox/Feed.pm
t/cgi.t

index 75e5d9532de3e7f0a21ec9344487b3c35b18e2aa..16b860cbde641baee0cdf9bb7dbee9b7c4a948a4 100644 (file)
@@ -56,6 +56,10 @@ sub generate_html_index {
                my $str = `git cat-file blob $_[0]`;
                return 0 if $? != 0;
                my $simple = Email::Simple->new($str);
+               if ($top && ($simple->header("In-Reply-To") ||
+                            $simple->header("References"))) {
+                       return 0;
+               }
                $simple->body_set(""); # save some memory
                push @messages, $simple;
                1;
diff --git a/t/cgi.t b/t/cgi.t
index c8755541211ffd3757480ba8b519a851a17e0831..91efca50a58a63c90fd90e81f8b859c9e6137f52 100644 (file)
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -134,7 +134,6 @@ EOF
 From: You <you\@example.com>
 To: Me <me\@example.com>
 Cc: $addr
-In-Reply-To: <blah\@example.com>
 Message-Id: <$slashy_mid>
 Subject: Re: hihi
 Date: Thu, 01 Jan 1970 00:00:01 +0000