From: Junio C Hamano Date: Mon, 06 Feb 2023 22:02:09 GMT Subject: Re: [PATCH] gitweb: fix base url set if PATH_INFO is used, add a / at the end. Message-ID: In-Reply-To: <585496b18c853140144c3e7ae13c0124@abrecht.li> Daniel Abrecht writes: > In HTML, if there is a base tag like ``, > a relative URL like `c/d` will be resolved by the browser as > `a/c/d` and not as `a/b/c/d`. But with a base tag like > `` it will result in `a/b/c/d`. So by > adding a slash there, the browser should now search the > files at the correct location. > > Signed-off-by: Daniel Abrecht > --- > gitweb/gitweb.perl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl > index e66eb3d9ba..acb2cce5f6 100755 > --- a/gitweb/gitweb.perl > +++ b/gitweb/gitweb.perl > @@ -4217,7 +4217,7 @@ sub git_header_html { > # the stylesheet, favicon etc urls won't work correctly with path_info > # unless we set the appropriate base URL > if ($ENV{'PATH_INFO'}) { > - print "\n"; > + print "\n"; Doesn't this need to be somewhat conditional? Sites like repo.or.cz currently give presumably because $base_url for them is '/', and this change will make them show double slashes instead of a single one, no?