update the isdir

This commit is contained in:
astaxie 2014-09-24 14:48:08 +08:00
parent 8164367762
commit f5f3395560
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ func serverStaticRouter(ctx *context.Context) {
if finfo.IsDir() && !DirectoryIndex {
middleware.Exception("403", ctx.ResponseWriter, ctx.Request, "403 Forbidden")
return
} else if ctx.Input.Request.URL.Path[len(ctx.Input.Request.URL.Path)-1] != '/' {
} else if finfo.IsDir() && ctx.Input.Request.URL.Path[len(ctx.Input.Request.URL.Path)-1] != '/' {
http.Redirect(ctx.ResponseWriter, ctx.Request, ctx.Input.Request.URL.Path+"/", 302)
return
}