]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Mbox.pm
hval: to_filename: return `undef' instead of empty string
[public-inbox.git] / lib / PublicInbox / Mbox.pm
index abdf43c93ac7c8059750a08f02d71495bd7fb53e..115321c610f70be296f46dcf1b2de38512fcd006 100644 (file)
@@ -1,12 +1,8 @@
 # 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';
@@ -56,9 +52,9 @@ sub async_eml { # ->{async_eml} for async_blob_cb
 
 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...