Skip to content

Commit

Permalink
gitweb: Make use of $PATH_INFO for project parameter
Browse files Browse the repository at this point in the history
Allow to have project name in the path part of URL, just after the name of
script. For example instead of gitweb.cgi?p=git.git you can write
gitweb.cgi/git.git or gitweb.cgi/git.git/

Not used in URLs inside gitweb; it means that the above alternate syntax
must be generated by hand, at least for now.

Side effect: project name parameter is now stripped of leading and
trailing slash before validation.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Jakub Narebski authored and Junio C Hamano committed Jun 21, 2006
1 parent 3f7f271 commit 49f582a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gitweb/gitweb.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ if (defined $order) {
}
}

my $project = $cgi->param('p');
my $project = ($cgi->param('p') || $ENV{'PATH_INFO'});
if (defined $project) {
$project =~ s|^/||; $project =~ s|/$||;
$project = validate_input($project);
if (!defined($project)) {
die_error(undef, "Invalid project parameter.");
Expand Down

0 comments on commit 49f582a

Please sign in to comment.