diff options
author | Eric Wong <e@80x24.org> | 2019-01-19 08:54:42 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-01-20 04:24:54 +0000 |
commit | f82593fc84a6773cd6fcb0633fdcca4cee92859f (patch) | |
tree | 74b696d1667cf36931b9e5c51ec0bf0f0671f242 /lib/PublicInbox/WWW.pm | |
parent | 37aadb7c7913442d470c050170639b37301cd6bf (diff) | |
download | public-inbox-f82593fc84a6773cd6fcb0633fdcca4cee92859f.tar.gz |
As with our use of the trailing slash in $MESSAGE_ID/T/ and '$MESSAGE_ID/t/' endpoints, this for 'wget -r --mirror' compatibility as well as allowing sysadmins to quickly stand up a static directory with "index.html" in it to reduce load.
Diffstat (limited to 'lib/PublicInbox/WWW.pm')
-rw-r--r-- | lib/PublicInbox/WWW.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index c73370f9..a0fd7fa7 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -118,10 +118,12 @@ sub call { r301($ctx, $1, $2); } elsif ($path_info =~ m!$INBOX_RE/_/text(?:/(.*))?\z!o) { get_text($ctx, $1, $2); - } elsif ($path_info =~ m!$INBOX_RE/($OID_RE)/s\z!o) { + } 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)/_([\w\.\-]+)\z!o) { + } elsif ($path_info =~ m!$INBOX_RE/($OID_RE)/s/([\w\.\-]+)\z!o) { 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); |