FIX: default GitBlit config is more Apache Proxy-friendly. Apache reverse proxy does not tolerate well the '/' encoded in the URL string as %2F: it does the translation before the proxy rule is applied causing confusion to GitBlit parameters mounted as URI path. Disabling the mounting of parameters in the URI path makes GitBlit plugin more "Apache-proxy" friendly and avoiding lots of headaches. Change-Id: I591be9e375858012916c0df4f55d3ad0d022b148 Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
diff --git a/src/main/java/com/googlesource/gerrit/plugins/gitblit/GitBlitInitStep.java b/src/main/java/com/googlesource/gerrit/plugins/gitblit/GitBlitInitStep.java index 0ab8ceb..d76594b 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/gitblit/GitBlitInitStep.java +++ b/src/main/java/com/googlesource/gerrit/plugins/gitblit/GitBlitInitStep.java
@@ -47,10 +47,10 @@ Section gitWeb = sections.get("gitweb", null); gitWeb.set("type", "custom"); gitWeb.set("url", "plugins/"); - gitWeb.set("project", pluginName + "/summary/${project}"); - gitWeb.set("revision", pluginName + "/commit/${project}/${commit}"); - gitWeb.set("branch", pluginName + "/log/${project}/${branch}"); - gitWeb.set("filehistory", pluginName + "/history/${project}/${branch}/${file}"); + gitWeb.set("project", pluginName + "/summary/?r=${project}"); + gitWeb.set("revision", pluginName + "/commit/?r=${project}&h=${commit}"); + gitWeb.set("branch", pluginName + "/log/?r=${project}&h=${branch}"); + gitWeb.set("filehistory", pluginName + "/history/?f=${file}&r=${project}&h=${branch}"); gitWeb.string("Link name", "linkname", "GitBlit"); }
diff --git a/src/main/resources/com/googlesource/gerrit/plugins/gitblit/reference.properties b/src/main/resources/com/googlesource/gerrit/plugins/gitblit/reference.properties index 98b109c..76c59e7 100644 --- a/src/main/resources/com/googlesource/gerrit/plugins/gitblit/reference.properties +++ b/src/main/resources/com/googlesource/gerrit/plugins/gitblit/reference.properties
@@ -487,7 +487,7 @@ # # SINCE 0.5.0 # RESTART REQUIRED -web.mountParameters = true +web.mountParameters = false # Some servlet containers (e.g. Tomcat >= 6.0.10) disallow '/' (%2F) encoding # in URLs as a security precaution for proxies. This setting tells Gitblit