mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-13 17:05:50 +01:00
Merge pull request #691 from team-lab/fix/#684-api-contextpath-support
fix/api context-path support
This commit is contained in:
@@ -63,10 +63,10 @@ object Implicits {
|
|||||||
|
|
||||||
implicit class RichRequest(request: HttpServletRequest){
|
implicit class RichRequest(request: HttpServletRequest){
|
||||||
|
|
||||||
def paths: Array[String] = (request.getRequestURI match{
|
def paths: Array[String] = (request.getRequestURI.substring(request.getContextPath.length + 1) match{
|
||||||
case path if path.startsWith("/api/v3/repos/") => path.substring(13/* "/api/v3/repos".length */)
|
case path if path.startsWith("api/v3/repos/") => path.substring(13/* "/api/v3/repos".length */)
|
||||||
case path => path
|
case path => path
|
||||||
}).substring(request.getContextPath.length + 1).split("/")
|
}).split("/")
|
||||||
|
|
||||||
def hasQueryString: Boolean = request.getQueryString != null
|
def hasQueryString: Boolean = request.getQueryString != null
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user