mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-15 18:05:50 +01:00
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.
This commit is contained in:
@@ -73,7 +73,7 @@ object Implicits {
|
|||||||
|
|
||||||
def hasAttribute(name: String): Boolean = request.getAttribute(name) != null
|
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 = {
|
def baseUrl:String = {
|
||||||
val url = request.getRequestURL.toString
|
val url = request.getRequestURL.toString
|
||||||
|
|||||||
Reference in New Issue
Block a user