Commit 8a37c30f authored by astaxie's avatar astaxie

fix #226

parent c4edc134
......@@ -382,7 +382,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
// pattern /admin url /admin 200 /admin/ 404
// pattern /admin/ url /admin 301 /admin/ 200
if requestPath[n-1] != '/' && len(route.pattern) == n+1 &&
route.pattern[n] == '/' && route.pattern[:n-1] == requestPath {
route.pattern[n] == '/' && route.pattern[:n] == requestPath {
http.Redirect(w, r, requestPath+"/", 301)
return
}
......
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