diff options
author | Eric Wong <e@80x24.org> | 2018-04-03 10:34:54 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2018-04-03 10:48:05 +0000 |
commit | 15eb65ffd59c7cf5cce67c6b7621f63194fd1083 (patch) | |
tree | cc27bbcebbb4ad88cd2c43ca0b4a8a68120f6988 /lib/PublicInbox/Mbox.pm | |
parent | 4f0b09919ae9c8823bf6c1fa1452bc27945952a3 (diff) | |
download | public-inbox-15eb65ffd59c7cf5cce67c6b7621f63194fd1083.tar.gz |
Having zero search results means we never get a chance to populate the Content-Disposition header for mbox downloads.
Diffstat (limited to 'lib/PublicInbox/Mbox.pm')
-rw-r--r-- | lib/PublicInbox/Mbox.pm | 7 |
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 ]; } |