summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2016-10-15 16:01:26 +0200
committerYorhel <git@yorhel.nl>2016-10-15 16:06:18 +0200
commit44df29ea185b1a4f72ec8006cf9f7c1e5aa0df45 (patch)
treeb7d5f36ce1d1353218bb087f0dfa6e8d171bdbde /www
parent20daba820f825fb6edc30cd5e10aef5bd713217a (diff)
Fix 404 on /(pkg|man)/<hash>
Diffstat (limited to 'www')
-rwxr-xr-xwww/index.pl12
1 files changed, 8 insertions, 4 deletions
diff --git a/www/index.pl b/www/index.pl
index 70e488c..ef17187 100755
--- a/www/index.pl
+++ b/www/index.pl
@@ -48,6 +48,14 @@ TUWF::register(
qr{info/about} => \&about,
qr{browse/search} => \&browsesearch,
+ # These have to go before the other mappings, to ensure that links work for
+ # man pages called 'pkg' or 'man'. This also means that we can't have a
+ # system named 8 hex digits, but at least that's easy to guarantee. :)
+ qr{([^/]+)/([0-9a-f]{8})} => \&man,
+ qr{([^/]+)/([0-9a-f]{8})/src} => \&src,
+ # We don't have any other single-component paths
+ qr{([^/]+)} => \&man,
+
qr{pkg/([^/]+)} => \&pkg_list,
# pkg/$system/$category/$name (/$version); $category may contain a slash, too.
qr{pkg/([^/]+)/(.+)} => \&pkg_info,
@@ -67,10 +75,6 @@ TUWF::register(
$self->resRedirect("/pkg/$sys->{short}/$pkgs->[0]{category}/$name".($ver ? "/$ver" :''), 'perm');
},
- qr{([^/]+)/([0-9a-f]{8})} => \&man,
- qr{([^/]+)/([0-9a-f]{8})/src} => \&src,
- qr{([^/]+)} => \&man,
-
# Redirect for a specific language for a man page.
# I'm not a fan of this solution; might drop it in the future.
qr{lang/([^/]+)/([^/]+)} => sub {