My gitweb installation works so far, but all generated links that include a querystring, e.g.
host/gitweb?p=somepath&a=summary
are somehow malformed. First, the ampersand is replaced by a semicolon. When inspecting the html, the link looks like
host/gitweb?p=somepath;a=summary
When klicking the link, the browser escapes the ';' to '%3b', so the url sent to the server looks like
host/gitweb?p=somepath%3ba=summary
The gitweb.cgi does not parse this and displays a 404 error page. When I replace the '%3b' with a ';' or a '&', everything works fine.
How can this be fixed on the server-side?
So far, I have tried to find the line producing the ';' in the urls, which is line 1457
$href .= "?" . join(';', @result) if scalar @result;
replacing the ';' by '&' gives me a malformed xhtml in the browser. Replacing it by '&' forces the browser again to escape the ';' which produces broken urls again.
The issue is kind of hidden (I can view the repositories), if I set the option
$feature{'pathinfo'}{'default'} = [1];
in the gitweb.conf file, but unfortunately, folders containing multiple repositories cannot be displayed, since the respective link uses some query-parameters.
You do not encoded or decoded the query string as a hole. The param name and value must be encoded and decoded individually and the delimiters of the query string i.e..
never get URL encoded or decoded.
You can check the server environment variable
$ENV{REQUEST_URI}to see if the server did receive the information encoded like you said. If the browser is sending it then that is the problem and there is nothing you can do in your Perl code to fix that. Because it will just cause more problems down the road in your Perl code.