From 95dc670eb42fef4e1100c856bc8b49bed8151d0a Mon Sep 17 00:00:00 2001 From: astaxie Date: Sat, 28 Dec 2013 23:06:20 +0800 Subject: [PATCH] fix #416 --- router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/router.go b/router.go index dde69679..d54576ec 100644 --- a/router.go +++ b/router.go @@ -580,7 +580,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) http.Redirect(w, r, requestPath+"/", 301) goto Admin } - if n >= 1 && requestPath[:n-1] == route.pattern { + if requestPath[n-1] == '/' && n >= 2 && requestPath[:n-2] == route.pattern { runMethod = p.getRunMethod(r.Method, context, route) if runMethod != "" { runrouter = route.controllerType