- if ($path_info eq '/') {
- r404();
- } elsif ($path_info =~ m!$LISTNAME_RE\z!o) {
- invalid_list(\%ctx, $1) || redirect_list_index(\%ctx, $cgi);
- } elsif ($path_info =~ m!$LISTNAME_RE(?:/|/index\.html)?\z!o) {
- invalid_list(\%ctx, $1) || get_index(\%ctx, $cgi, 0);
- } elsif ($path_info =~ m!$LISTNAME_RE/atom\.xml\z!o) {
- invalid_list(\%ctx, $1) || get_atom(\%ctx, $cgi, 0);
-
- # single-message pages
- } elsif ($path_info =~ m!$LISTNAME_RE/m/(\S+)\.txt\z!o) {
- invalid_list_mid(\%ctx, $1, $2) || get_mid_txt(\%ctx, $cgi);
- } elsif ($path_info =~ m!$LISTNAME_RE/m/(\S+)\.html\z!o) {
- invalid_list_mid(\%ctx, $1, $2) || get_mid_html(\%ctx, $cgi);
-
- # full-message page
- } elsif ($path_info =~ m!$LISTNAME_RE/f/(\S+)\.html\z!o) {
- invalid_list_mid(\%ctx, $1, $2) || get_full_html(\%ctx, $cgi);
-
- # convenience redirects, order matters
- } elsif ($path_info =~ m!$LISTNAME_RE/(?:m|f)/(\S+)\z!o) {
- invalid_list_mid(\%ctx, $1, $2) || redirect_mid(\%ctx, $cgi);
+ if ($path_info eq '/' || $path_info eq '/manifest.js.gz') {
+ www_listing($self)->call($env);
+ } elsif ($path_info =~ m!$INBOX_RE\z!o) {
+ invalid_inbox($ctx, $1) || r301($ctx, $1);
+ } elsif ($path_info =~ m!$INBOX_RE(?:/|/index\.html)?\z!o) {
+ invalid_inbox($ctx, $1) || get_index($ctx);
+ } elsif ($path_info =~ m!$INBOX_RE/(?:atom\.xml|new\.atom)\z!o) {
+ invalid_inbox($ctx, $1) || get_atom($ctx);
+ } elsif ($path_info =~ m!$INBOX_RE/new\.html\z!o) {
+ invalid_inbox($ctx, $1) || get_new($ctx);
+ } elsif ($path_info =~ m!$INBOX_RE/description\z!o) {
+ get_description($ctx, $1);
+ } elsif ($path_info =~ m!$INBOX_RE/(?:(?:git/)?([0-9]+)(?:\.git)?/)?
+ ($PublicInbox::GitHTTPBackend::ANY)\z!ox) {
+ my ($epoch, $path) = ($2, $3);
+ invalid_inbox($ctx, $1) || serve_git($ctx, $epoch, $path);
+ } elsif ($path_info =~ m!$INBOX_RE/([a-zA-Z0-9_\-]+).mbox\.gz\z!o) {
+ serve_mbox_range($ctx, $1, $2);
+ } elsif ($path_info =~ m!$INBOX_RE/$MID_RE/$END_RE\z!o) {
+ msg_page($ctx, $1, $2, $3);
+
+ } elsif ($path_info =~ m!$INBOX_RE/$MID_RE/$ATTACH_RE\z!o) {
+ my ($idx, $fn) = ($3, $4);
+ invalid_inbox_mid($ctx, $1, $2) || get_attach($ctx, $idx, $fn);
+ # in case people leave off the trailing slash:
+ } elsif ($path_info =~ m!$INBOX_RE/$MID_RE/(T|t)\z!o) {
+ my ($inbox, $mid_ue, $suffix) = ($1, $2, $3);
+ $suffix .= $suffix =~ /\A[tT]\z/ ? '/#u' : '/';
+ r301($ctx, $inbox, $mid_ue, $suffix);
+
+ } elsif ($path_info =~ m!$INBOX_RE/$MID_RE/R/?\z!o) {
+ my ($inbox, $mid_ue) = ($1, $2);
+ r301($ctx, $inbox, $mid_ue, '#R');
+
+ } elsif ($path_info =~ m!$INBOX_RE/$MID_RE/f/?\z!o) {
+ r301($ctx, $1, $2);
+ } elsif ($path_info =~ m!$INBOX_RE/_/text(?:/(.*))?\z!o) {
+ get_text($ctx, $1, $2);
+ } elsif ($path_info =~ m!$INBOX_RE/([a-zA-Z0-9_\-\.]+)\.css\z!o) {
+ get_css($ctx, $1, $2);
+ } elsif ($path_info =~ m!$INBOX_RE/manifest\.js\.gz\z!o) {
+ get_inbox_manifest($ctx, $1, $2);
+ } elsif ($path_info =~ m!$INBOX_RE/($OID_RE)/s/\z!o) {
+ get_vcs_object($ctx, $1, $2);
+ } elsif ($path_info =~ m!$INBOX_RE/($OID_RE)/s/
+ ($PublicInbox::Hval::FN)\z!ox) {
+ get_vcs_object($ctx, $1, $2, $3);
+ } elsif ($path_info =~ m!$INBOX_RE/($OID_RE)/s\z!o) {
+ r301($ctx, $1, $2, 's/');
+ # convenience redirects order matters
+ } elsif ($path_info =~ m!$INBOX_RE/([^/]{2,})\z!o) {
+ r301($ctx, $1, $2);