mirror of
https://github.com/gitbucket/gitbucket.git
synced 2026-05-05 23:46:01 +02:00
Merge pull request #1249 from shiena/patch/fix-git-repo-path
fix: can't resolve the git repository path provided by the plugin
This commit is contained in:
@@ -4,6 +4,8 @@ import gitbucket.core.api.JsonFormat
|
||||
import gitbucket.core.controller.Context
|
||||
import gitbucket.core.servlet.Database
|
||||
|
||||
import java.util.regex.Pattern.quote
|
||||
|
||||
import javax.servlet.http.{HttpSession, HttpServletRequest}
|
||||
|
||||
import scala.util.matching.Regex
|
||||
@@ -73,7 +75,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("^" + quote(request.getContextPath) + "/git/", "/")
|
||||
|
||||
def baseUrl:String = {
|
||||
val url = request.getRequestURL.toString
|
||||
|
||||
Reference in New Issue
Block a user