Merge pull request #691 from team-lab/fix/#684-api-contextpath-support

fix/api context-path support
This commit is contained in:
Naoki Takezoe
2015-04-03 22:31:09 +09:00

View File

@@ -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