about summary refs log tree commit homepage
path: root/lib/PublicInbox/WWW.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/WWW.pm')
-rw-r--r--lib/PublicInbox/WWW.pm20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm
index 52e51c43..7fe9b85b 100644
--- a/lib/PublicInbox/WWW.pm
+++ b/lib/PublicInbox/WWW.pm
@@ -53,8 +53,13 @@ sub run {
         } elsif ($path_info =~ m!$LISTNAME_RE/t/(\S+)\.html\z!o) {
                 invalid_list_mid(\%ctx, $1, $2) || get_thread(\%ctx, $cgi);
 
+        # subject_path display
+        } elsif ($path_info =~ m!$LISTNAME_RE/s/(\S+)\.html\z!o) {
+                my $sp = $2;
+                invalid_list(\%ctx, $1) || get_subject_path(\%ctx, $cgi, $sp);
+
         # convenience redirects, order matters
-        } elsif ($path_info =~ m!$LISTNAME_RE/(m|f|t)/(\S+)\z!o) {
+        } elsif ($path_info =~ m!$LISTNAME_RE/(m|f|t|s)/(\S+)\z!o) {
                 my $pfx = $2;
                 invalid_list_mid(\%ctx, $1, $3) ||
                         redirect_mid(\%ctx, $cgi, $2);
@@ -211,6 +216,19 @@ sub get_thread {
           [ $body ] ];
 }
 
+# /$LISTNAME/s/$SUBJECT_PATH.html
+sub get_subject_path {
+        my ($ctx, $cgi, $sp) = @_;
+        $ctx->{subject_path} = $sp;
+        my $srch = searcher($ctx) or return need_search($ctx);
+        require PublicInbox::View;
+        my $foot = footer($ctx);
+        my $body = PublicInbox::View->subject_path_html($ctx, $foot, $srch) or
+                return r404();
+        [ 200, [ 'Content-Type' => 'text/html; charset=UTF-8' ],
+          [ $body ] ];
+}
+
 sub self_url {
         my ($cgi) = @_;
         ref($cgi) eq 'CGI' ? $cgi->self_url : $cgi->uri->as_string;