about summary refs log tree commit homepage
path: root/lib/PublicInbox/Mbox.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/Mbox.pm')
-rw-r--r--lib/PublicInbox/Mbox.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm
index 84cc3845..04c86cc1 100644
--- a/lib/PublicInbox/Mbox.pm
+++ b/lib/PublicInbox/Mbox.pm
@@ -157,7 +157,12 @@ sub response {
         # http://www.iana.org/assignments/media-types/application/gzip
         $body->{hdr} = [ 'Content-Type', 'application/gzip' ];
         $body->{fn} = $fn;
-        my $hdr = $body->getline; # fill in Content-Disposition filename
+        # fill in Content-Disposition filename
+        my $hdr = $body->getline;
+        if ($body->{hdr}) {
+                return [ 404, ['Content-Type','text/plain'],
+                        [ "No results found\n" ] ];
+        }
         [ 200, $hdr, $body ];
 }