1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 22:51:29 +00:00

fix router's bug

This commit is contained in:
astaxie 2013-07-30 22:33:36 +08:00
parent 8674b81b3a
commit 572e281566

View File

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