]> Lady’s Gitweb - Gitweb/commit
gitweb: fix wrong base URL when non-root DirectoryIndex
authorGiuseppe Bilotta <redacted>
Sun, 15 Feb 2009 09:18:36 +0000 (10:18 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:50:38 +0000 (00:50 -0400)
commitb5eabe29647cb35c302a69334241b51ae23bad6eea2d34c7fd507de9c3c3a4d4
treea5cffb8aade6da8633118d0c9c1cc1eeb5646c251f181cc5aefb37fc616cb701
parent2ea1d67c50c405bb76e471563bf87ed8643aa905469e8c8c9630b81d5eea0d24
gitweb: fix wrong base URL when non-root DirectoryIndex

CGI::url() has some issues when rebuilding the script URL if the script
is a DirectoryIndex.

One of these issue is the inability to strip PATH_INFO, which is why
we had to do it ourselves.

Another issue is that the resulting URL cannot be used for the <base>
tag: it works if we're the DirectoryIndex at the root level, but not
otherwise.

We fix this by building the proper base URL ourselves, and improve the
comment about the need to strip PATH_INFO manually while we're at it.

Additionally t/t9500-gitweb-standalone-no-errors.sh had to be modified
to set SCRIPT_NAME variable (CGI standard states that it MUST be set,
and now gitweb uses it if PATH_INFO is not empty, as is the case for
some of tests in t9500).

Signed-off-by: Giuseppe Bilotta <redacted>
Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl
This page took 0.195497 seconds and 4 git commands to generate.