# Copyright (C) 2015-2020 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
-# Streaming (via getline) interface for formatting messages as an mboxrd.
-# Used by the PSGI web interface.
-#
-# public-inbox-httpd favors "getline" response bodies to take a
-# "pull"-based approach to feeding slow clients (as opposed to a
-# more common "push" model)
+# Streaming interface for mboxrd HTTP responses
+# See PublicInbox::GzipFilter for details.
package PublicInbox::Mbox;
use strict;
use parent 'PublicInbox::GzipFilter';
sub res_hdr ($$) {
my ($ctx, $subject) = @_;
- my $fn = $subject // 'no-subject';
+ my $fn = $subject // '';
$fn =~ s/^re:\s+//i;
- $fn = $fn eq '' ? 'no-subject' : to_filename($fn);
+ $fn = to_filename($fn) // 'no-subject';
my @hdr = ('Content-Type');
if ($ctx->{-inbox}->{obfuscate}) {
# obfuscation is stupid, but maybe scrapers are, too...