a997ca74 by astaxie

fix router's /path/

1 parent 572e2815
...@@ -386,7 +386,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) ...@@ -386,7 +386,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
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 (len(route.pattern) == n+1 && requestPath == route.pattern[0:n]) {
390 runrouter = route 390 runrouter = route
391 findrouter = true 391 findrouter = true
392 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!