572e2815 by astaxie

fix router's bug

1 parent 8674b81b
...@@ -385,7 +385,8 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) ...@@ -385,7 +385,8 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
385 } 385 }
386 386
387 if (requestPath[n-1] != '/' && route.pattern == requestPath) || 387 if (requestPath[n-1] != '/' && route.pattern == requestPath) ||
388 (requestPath[n-1] == '/' && len(route.pattern) >= n-1 && requestPath[0:n-1] == route.pattern) { 388 (requestPath[n-1] == '/' && len(route.pattern) >= n-1 && requestPath[0:n-1] == route.pattern) ||
389 (len(route.pattern)-1 == n && requestPath == route.pattern[:n-1]) {
389 runrouter = route 390 runrouter = route
390 findrouter = true 391 findrouter = true
391 break 392 break
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!