Skip to content

Commit

Permalink
Fix problem when GitBucket is working on non root context.
Browse files Browse the repository at this point in the history
  • Loading branch information
takezoe committed Jul 4, 2013
1 parent c3e668d commit 07512f1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/scala/servlet/GitRepositoryServlet.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ class GitBucketReceivePackFactory extends ReceivePackFactory[HttpServletRequest]

private val logger = LoggerFactory.getLogger(classOf[GitBucketReceivePackFactory])

override def create(req: HttpServletRequest, db: Repository): ReceivePack = {
override def create(request: HttpServletRequest, db: Repository): ReceivePack = {
val receivePack = new ReceivePack(db)
val userName = req.getAttribute("USER_NAME")
val userName = request.getAttribute("USER_NAME")

logger.debug("requestURI: " + req.getRequestURI)
logger.debug("requestURI: " + request.getRequestURI)
logger.debug("userName:" + userName)
val pathList = req.getRequestURI.split("/")
val owner = pathList(2)
val repository = pathList(3).replaceFirst("\\.git$", "")

val paths = request.getRequestURI.substring(request.getContextPath.length).split("/")
val owner = paths(2)
val repository = paths(3).replaceFirst("\\.git$", "")

logger.debug("repository:" + owner + "/" + repository)

Expand Down

0 comments on commit 07512f1

Please sign in to comment.