Fix Gitweb HTTP URL generation
Gitweb was generating an invalid URL for HTTP. Remove invalid p character from URL and require authentication if the project is not visible to anonymous users. Change-Id: I99d426c8a630a9f0abfc0f66a3978a9e6b2ad0b6
This commit is contained in:
@@ -232,7 +232,10 @@ class GitwebServlet extends HttpServlet {
|
||||
p.print(" if (( $secure && $ENV{'SERVER_PORT'} != 443)\n");
|
||||
p.print(" || (!$secure && $ENV{'SERVER_PORT'} != 80)\n");
|
||||
p.print(" );\n");
|
||||
p.print(" $http_url .= qq{$ENV{'GERRIT_CONTEXT_PATH'}p};\n");
|
||||
p.print(" $http_url .= qq{$ENV{'GERRIT_CONTEXT_PATH'}};\n");
|
||||
p.print(" $http_url .= qq{/a}\n");
|
||||
p.print(" unless $ENV{'GERRIT_ANONYMOUS_READ'};\n");
|
||||
p.print(" \n");
|
||||
p.print(" push @git_base_url_list, $http_url;\n");
|
||||
p.print("}\n");
|
||||
|
||||
@@ -542,7 +545,7 @@ class GitwebServlet extends HttpServlet {
|
||||
env.set("HTTP_" + name.toUpperCase().replace('-', '_'), value);
|
||||
}
|
||||
|
||||
env.set("GERRIT_CONTEXT_PATH", req.getContextPath() + "/");
|
||||
env.set("GERRIT_CONTEXT_PATH", req.getContextPath());
|
||||
env.set("GERRIT_PROJECT_NAME", project.getProject().getName());
|
||||
|
||||
env.set("GITWEB_PROJECTROOT",
|
||||
|
Reference in New Issue
Block a user