fix router's /path/
Showing
1 changed file
with
1 additions
and
1 deletions
| ... | @@ -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 | ... | ... |
-
Please register or sign in to post a comment