4353c98f by astaxie

fix router's bug when requestpath only have one character

1 parent d1a5397d
......@@ -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
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!