]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: remove PATH_INFO from $my_url and $my_uri
authorGiuseppe Bilotta <redacted>
Mon, 29 Sep 2008 13:07:42 +0000 (15:07 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:34 +0000 (00:07 -0400)
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 <redacted>
Acked-by: Jakub Narebski <redacted>
Acked-by: Petr Baudis <redacted>
Signed-off-by: Shawn O. Pearce <redacted>
gitweb.perl

index 5ac2233929773b7cf14348f23a1e2893372a5d9cbaae1f5aba77be68c2561fc4..87c50e6e9f3fc13155de178a21e9125589f9106bbece735b8a0ee4ed8cec6a6b 100755 (executable)
@@ -27,6 +27,13 @@ our $version = "++GIT_VERSION++";
 our $my_url = $cgi->url();
 our $my_uri = $cgi->url(-absolute => 1);
 
+# if we're called with PATH_INFO, we have to strip that
+# from the URL to find our real URL
+if (my $path_info = $ENV{"PATH_INFO"}) {
+       $my_url =~ s,\Q$path_info\E$,,;
+       $my_uri =~ s,\Q$path_info\E$,,;
+}
+
 # core git executable to use
 # this can just be "git" if your webserver has a sensible PATH
 our $GIT = "++GIT_BINDIR++/git";
This page took 0.351097 seconds and 4 git commands to generate.