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 <giuseppe.bilotta@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Acked-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Giuseppe Bilotta committed
Sep 29, 2008 at 15:07 UTC
b65910fec21db070ac40521e4b375fca76d27c90
1 file changed
+7
gitweb/gitweb.perl
+7
@@ -27,6 +27,13 @@ our $version = "++GIT_VERSION++";
27
our $my_url = $cgi->url();
28
our $my_uri = $cgi->url(-absolute => 1);
29
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
+
37
# core git executable to use
38
# this can just be "git" if your webserver has a sensible PATH
39
our $GIT = "++GIT_BINDIR++/git";