Skip to content

Commit b65910f

Browse files
Oblomovspearce
authored andcommitted
gitweb: remove PATH_INFO from $my_url and $my_uri
This patch fixes PATH_INFO handling by removing the relevant part from $my_url and $my_uri, thus making it unnecessary to specify them by hand in the gitweb configuration. Signed-off-by: Giuseppe Bilotta <[email protected]> Acked-by: Jakub Narebski <[email protected]> Acked-by: Petr Baudis <[email protected]> Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent b1524ee commit b65910f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

gitweb/gitweb.perl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ BEGIN
2727
our $my_url = $cgi->url();
2828
our $my_uri = $cgi->url(-absolute => 1);
2929

30+
# if we're called with PATH_INFO, we have to strip that
31+
# from the URL to find our real URL
32+
if (my $path_info = $ENV{"PATH_INFO"}) {
33+
$my_url =~ s,\Q$path_info\E$,,;
34+
$my_uri =~ s,\Q$path_info\E$,,;
35+
}
36+
3037
# core git executable to use
3138
# this can just be "git" if your webserver has a sensible PATH
3239
our $GIT = "++GIT_BINDIR++/git";

0 commit comments

Comments
 (0)