if ($method eq 'HEAD') {
$head = 1;
} elsif ($method eq 'GET') {
- ($data{username}, $data{repository}) = $uri =~ m{/([a-zA-Z0-9_]+?)/(?:([a-zA-Z0-9_.]+))?}; # [[:alnum:]] didn't work
+ ($data{username}, $data{repository}) = $uri =~ m{^/([a-zA-Z0-9_]+)(?:/([a-zA-Z0-9_\.]+))?$}; # [[:alnum:]] didn't work
info("name:", $data{username} || '', "repo:", $data{repository} || '');
if ($uri eq '/') {
%data = %{GN::index($public, \%data)};
<body>
<h1>[% title %]</h1>
<h2>[% description %]</h2>
-<ul>[% FOR i IN directories %]<li><a href="/[% i %]/">/[% i %]</a></li>[% END %]</ul>
+<ul>[% FOR i IN directories %]<li><a href="/[% i %]">/[% i %]</a></li>[% END %]</ul>
</body>
[% INCLUDE foot.tt %]
</html>
<html>
-[% title = "${name} Index" %]
+[% title = "${username} Index" %]
[% INCLUDE head.tt %]
<body>
<h1>[% title %]</h1>
-<ul>[% FOR i IN directories %]<li><a href="/[% name %]/[% i %]">/[% name %]/[% i %]</a></li>[% END %]</ul>
+<ul>[% FOR i IN directories %]<li><a href="/[% username %]/[% i %]">/[% username %]/[% i %]</a></li>[% END %]</ul>
</body>
[% INCLUDE foot.tt %]
</html>
<html>
-[% title = "/${name}/${repository}" %]
+[% title = "/${username}/${repository}" %]
[% INCLUDE head.tt %]
<body>
<h1>[% title %]</h1>