about summary refs log tree commit homepage
path: root/lib/PublicInbox/WWW.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-08-27 04:34:01 +0000
committerEric Wong <e@80x24.org>2015-08-27 06:04:51 +0000
commit9a2931759c3dcbd879728b49151aa3f8a641b506 (patch)
tree001d6823d7d9d143d3494ad8376d624ea1ca6afc /lib/PublicInbox/WWW.pm
parente3c3cde22f57bf16bc47c50d8f9ac02416975cd3 (diff)
downloadpublic-inbox-9a2931759c3dcbd879728b49151aa3f8a641b506.tar.gz
These URLs are preferable in case somebody decides to get cute and
use a suffix we would've used to prevent others from linking to
their message.  The common /m/$MESSAGE_ID/ URLs are now 4 characters
shorter so may fit better on terminals.
Diffstat (limited to 'lib/PublicInbox/WWW.pm')
-rw-r--r--lib/PublicInbox/WWW.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm
index ca338fb4..ceb34d67 100644
--- a/lib/PublicInbox/WWW.pm
+++ b/lib/PublicInbox/WWW.pm
@@ -56,6 +56,9 @@ sub run {
                 invalid_list_mid(\%ctx, $1, $2) || get_full_html(\%ctx);
 
         # thread display
+        } elsif ($path_info =~ m!$LISTNAME_RE/t/(\S+)/\z!o) {
+                invalid_list_mid(\%ctx, $1, $2) || get_thread(\%ctx);
+
         } elsif ($path_info =~ m!$LISTNAME_RE/t/(\S+)\.html\z!o) {
                 invalid_list_mid(\%ctx, $1, $2) || get_thread(\%ctx);
 
@@ -220,7 +223,7 @@ sub redirect_mid {
         if (lc($pfx) eq 't') {
                 $anchor = '#u'; # <u id='#u'> is used to highlight in View.pm
         }
-        do_redirect($url . ".html$anchor");
+        do_redirect($url . "/$anchor");
 }
 
 # only hit when somebody tries to guess URLs manually:
@@ -329,7 +332,7 @@ EOF
 sub msg_pfx {
         my ($ctx) = @_;
         my $href = PublicInbox::Hval::ascii_html(uri_escape_utf8($ctx->{mid}));
-        "../f/$href.html";
+        "../../f/$href/";
 }
 
 # /$LISTNAME/t/$MESSAGE_ID/mbox           -> thread as mbox