From 485516be2e665b562c35e48e120a7ff514b28f37 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Koga Date: Mon, 25 Jul 2016 22:43:51 +0900 Subject: [PATCH] fix: can't resolve the git repository path provided by the plugin If the contextPath is not equals to `/`, gitRepositoryPath contains the contextPath + `/git`. Therefore, gitbucket can not resolve the git repository path provided by the plugin. For example, you can not clone the snippets repository of gist-plugin. To fix this, also deletes contextPath from requestURI. --- src/main/scala/gitbucket/core/util/Implicits.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/gitbucket/core/util/Implicits.scala b/src/main/scala/gitbucket/core/util/Implicits.scala index a7209de94..0496fb12b 100644 --- a/src/main/scala/gitbucket/core/util/Implicits.scala +++ b/src/main/scala/gitbucket/core/util/Implicits.scala @@ -73,7 +73,7 @@ object Implicits { def hasAttribute(name: String): Boolean = request.getAttribute(name) != null - def gitRepositoryPath: String = request.getRequestURI.replaceFirst("^/git/", "/") + def gitRepositoryPath: String = request.getRequestURI.replaceFirst("^" + request.getContextPath + "/git/", "/") def baseUrl:String = { val url = request.getRequestURL.toString