Commit 572e2815 authored by astaxie's avatar astaxie

fix router's bug

parent 8674b81b
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment