invalid_list(\%ctx, $1) || get_atom(\%ctx);
# single-message pages
+ } elsif ($path_info =~ m!$LISTNAME_RE/m/(\S+)/\z!o) {
+ invalid_list_mid(\%ctx, $1, $2) || get_mid_html(\%ctx);
+ } elsif ($path_info =~ m!$LISTNAME_RE/m/(\S+)/raw\z!o) {
+ invalid_list_mid(\%ctx, $1, $2) || get_mid_txt(\%ctx);
} elsif ($path_info =~ m!$LISTNAME_RE/m/(\S+)\.txt\z!o) {
invalid_list_mid(\%ctx, $1, $2) || get_mid_txt(\%ctx);
} elsif ($path_info =~ m!$LISTNAME_RE/m/(\S+)\.html\z!o) {
invalid_list_mid(\%ctx, $1, $2) || get_mid_html(\%ctx);
# full-message page
+ } elsif ($path_info =~ m!$LISTNAME_RE/f/(\S+)/\z!o) {
+ invalid_list_mid(\%ctx, $1, $2) || get_full_html(\%ctx);
} elsif ($path_info =~ m!$LISTNAME_RE/f/(\S+)\.html\z!o) {
invalid_list_mid(\%ctx, $1, $2) || get_full_html(\%ctx);
} elsif ($path_info =~ m!$LISTNAME_RE/t/(\S+)\.html\z!o) {
invalid_list_mid(\%ctx, $1, $2) || get_thread(\%ctx);
- } elsif ($path_info =~ m!$LISTNAME_RE/t/(\S+)\.mbox(\.gz)?\z!o) {
+ } elsif ($path_info =~ m!$LISTNAME_RE/t/(\S+)/mbox(\.gz)?\z!ox ||
+ $path_info =~ m!$LISTNAME_RE/t/(\S+)\.mbox(\.gz)?\z!o) {
my $sfx = $3;
invalid_list_mid(\%ctx, $1, $2) ||
get_thread_mbox(\%ctx, $sfx);
"../f/$href.html";
}
-# /$LISTNAME/t/$MESSAGE_ID.mbox -> thread as mbox
-# /$LISTNAME/t/$MESSAGE_ID.mbox.gz -> thread 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.
{
local $ENV{HOME} = $home;
local $ENV{PATH} = $main_path;
- my $path = "/test/t/blahblah%40example.com.mbox.gz";
+ my $path = "/test/t/blahblah%40example.com/mbox.gz";
my $res = cgi_run($path);
like($res->{head}, qr/^Status: 501 /, "search not-yet-enabled");
my $indexed = system($index, $maindir) == 0;
qr!link\s+href="\Q$pfx\E/m/blah%40example\.com\.html"!s,
'atom feed generated correct URL');
});
+
+ foreach my $t (qw(f m)) {
+ test_psgi($app, sub {
+ my ($cb) = @_;
+ my $pfx = 'http://example.com/test';
+ my $path = "/$t/blah%40example.com/";
+ my $res = $cb->(GET($pfx . $path));
+ is(200, $res->code, "success for $path");
+ like($res->content, qr!<title>hihi - Me</title>!,
+ "HTML returned");
+ });
+ }
+ test_psgi($app, sub {
+ my ($cb) = @_;
+ my $pfx = 'http://example.com/test';
+ my $res = $cb->(GET($pfx . '/m/blah%40example.com/raw'));
+ is(200, $res->code, 'success response received for /m/*/raw');
+ like($res->content, qr!\AFrom !, "mbox returned");
+ });
}
done_testing();