]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Mbox.pm
mbox: show application/mbox for obfuscated inboxes
[public-inbox.git] / lib / PublicInbox / Mbox.pm
index fd623f6d48bd4e63ae3fc8d762e5a75fed39f993..88daba752153385ed74656cae0699078a65139c3 100644 (file)
@@ -12,8 +12,12 @@ require Email::Simple;
 sub emit1 {
        my ($ctx, $msg) = @_;
        $msg = Email::Simple->new($msg);
-       # single message should be easily renderable in browsers
-       [200, ['Content-Type', 'text/plain'], [ msg_str($ctx, $msg)] ]
+
+       # single message should be easily renderable in browsers,
+       # unless obfuscation is enabled :<
+       [ 200, [ 'Content-Type',
+         $ctx->{-inbox}->{obfuscate} ? 'application/mbox' : 'text/plain' ],
+        [ msg_str($ctx, $msg)] ]
 }
 
 sub msg_str {
@@ -115,7 +119,7 @@ sub new {
                cb => $cb,
                ctx => $ctx,
                msgs => [],
-               opts => { asc => 1, offset => 0 },
+               opts => { offset => 0 },
        }, $class;
 }