1
0
의 미러 https://github.com/astaxie/beego.git synced 2025-07-17 18:52:16 +00:00

fix router's bug when requestpath only have one character

This commit is contained in:
astaxie
2013-04-08 21:26:38 +08:00
부모 d1a5397d67
커밋 4353c98fd0

파일 보기

@@ -249,7 +249,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
}
if (requestPath[n-1] != '/' && route.pattern == requestPath) ||
(len(route.pattern) >= n-1 && requestPath[0:n-1] == route.pattern) {
(requestPath[n-1] == '/' && len(route.pattern) >= n-1 && requestPath[0:n-1] == route.pattern) {
runrouter = route
findrouter = true
break