} elsif ($path_info =~ m!$LISTNAME_RE/t/(\S+)\.html\z!o) {
invalid_list_mid(\%ctx, $1, $2) || get_thread(\%ctx, $cgi);
- } elsif ($path_info =~ m!$LISTNAME_RE/t/(\S+)\.mbox\.gz!o) {
+ } elsif ($path_info =~ m!$LISTNAME_RE/t/(\S+)\.mbox(\.gz)?\z!o) {
my $sfx = $3;
- invalid_list_mid(\%ctx, $1, $2) || get_thread_mbox(\%ctx, $cgi);
+ invalid_list_mid(\%ctx, $1, $2) ||
+ get_thread_mbox(\%ctx, $cgi, $sfx);
} elsif ($path_info =~ m!$LISTNAME_RE/f/\S+\.txt\z!o) {
invalid_list_mid(\%ctx, $1, $2) ||
"../f/$href.html";
}
-# /$LISTNAME/t/$MESSAGE_ID.mbox.gz -> search results as gzipped mbox
+# /$LISTNAME/t/$MESSAGE_ID.mbox -> thread as mbox
+# /$LISTNAME/t/$MESSAGE_ID.mbox.gz -> thread as gzipped mbox
# note: I'm not a big fan of other compression formats since they're
# significantly more expensive on CPU than gzip and less-widely available,
# especially on older systems. Stick to zlib since that's what git uses.
sub get_thread_mbox {
- my ($ctx, $cgi) = @_;
+ my ($ctx, $cgi, $sfx) = @_;
my $srch = searcher($ctx) or return need_search($ctx);
require PublicInbox::Mbox;
- PublicInbox::Mbox::thread_mbox($ctx, $srch);
+ PublicInbox::Mbox::thread_mbox($ctx, $srch, $sfx);
}
1;